From ff869269995be0ddf0ab6864b167f3f5d7a98831 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 30 Oct 2024 02:44:01 +0000 Subject: [PATCH 1/3] code and test --- .../azure-mgmt-edgeorder/CHANGELOG.md | 43 + sdk/edgeorder/azure-mgmt-edgeorder/README.md | 12 +- sdk/edgeorder/azure-mgmt-edgeorder/_meta.json | 10 +- .../azure/mgmt/edgeorder/__init__.py | 18 +- .../azure/mgmt/edgeorder/_configuration.py | 58 +- .../_edge_order_management_client.py | 214 +- .../azure/mgmt/edgeorder/_operations_mixin.py | 895 ---- .../{v2020_12_01_preview => }/_patch.py | 0 .../azure/mgmt/edgeorder/_serialization.py | 128 +- .../{v2021_12_01/aio => }/_vendor.py | 8 +- .../azure/mgmt/edgeorder/_version.py | 2 +- .../azure/mgmt/edgeorder/aio/__init__.py | 15 +- .../mgmt/edgeorder/aio/_configuration.py | 58 +- .../aio/_edge_order_management_client.py | 214 +- .../mgmt/edgeorder/aio/_operations_mixin.py | 904 ---- .../{v2020_12_01_preview => }/aio/_patch.py | 0 .../{v2020_12_01_preview => }/aio/_vendor.py | 4 +- .../aio/operations/__init__.py | 0 ...edge_order_management_client_operations.py | 1129 ++--- .../aio/operations/_patch.py | 0 .../azure/mgmt/edgeorder/models.py | 7 - .../{v2021_12_01 => }/models/__init__.py | 0 .../_edge_order_management_client_enums.py | 4 +- .../{v2021_12_01 => }/models/_models_py3.py | 528 ++- .../models/_patch.py | 0 .../operations/__init__.py | 0 ...edge_order_management_client_operations.py | 1211 +++--- .../operations/_patch.py | 0 .../edgeorder/v2020_12_01_preview/__init__.py | 26 - .../v2020_12_01_preview/_configuration.py | 72 - .../_edge_order_management_client.py | 90 - .../v2020_12_01_preview/_metadata.json | 479 --- .../edgeorder/v2020_12_01_preview/_vendor.py | 48 - .../edgeorder/v2020_12_01_preview/_version.py | 9 - .../v2020_12_01_preview/aio/__init__.py | 23 - .../v2020_12_01_preview/aio/_configuration.py | 72 - .../aio/_edge_order_management_client.py | 90 - ...edge_order_management_client_operations.py | 2963 ------------- .../v2020_12_01_preview/models/__init__.py | 207 - .../_edge_order_management_client_enums.py | 291 -- .../v2020_12_01_preview/models/_models_py3.py | 3237 -------------- ...edge_order_management_client_operations.py | 3716 ----------------- .../edgeorder/v2020_12_01_preview/py.typed | 1 - .../mgmt/edgeorder/v2021_12_01/__init__.py | 26 - .../edgeorder/v2021_12_01/_configuration.py | 72 - .../_edge_order_management_client.py | 90 - .../mgmt/edgeorder/v2021_12_01/_metadata.json | 479 --- .../mgmt/edgeorder/v2021_12_01/_patch.py | 20 - .../mgmt/edgeorder/v2021_12_01/_vendor.py | 48 - .../mgmt/edgeorder/v2021_12_01/_version.py | 9 - .../edgeorder/v2021_12_01/aio/__init__.py | 23 - .../v2021_12_01/aio/_configuration.py | 72 - .../aio/_edge_order_management_client.py | 90 - .../mgmt/edgeorder/v2021_12_01/aio/_patch.py | 20 - .../v2021_12_01/aio/operations/__init__.py | 19 - .../v2021_12_01/aio/operations/_patch.py | 20 - .../edgeorder/v2021_12_01/models/_patch.py | 20 - .../v2021_12_01/operations/__init__.py | 19 - .../v2021_12_01/operations/_patch.py | 20 - .../azure/mgmt/edgeorder/v2021_12_01/py.typed | 1 - .../edgeorder/v2022_05_01_preview/__init__.py | 26 - .../v2022_05_01_preview/_configuration.py | 72 - .../_edge_order_management_client.py | 112 - .../v2022_05_01_preview/_metadata.json | 114 - .../edgeorder/v2022_05_01_preview/_patch.py | 20 - .../edgeorder/v2022_05_01_preview/_vendor.py | 30 - .../edgeorder/v2022_05_01_preview/_version.py | 9 - .../v2022_05_01_preview/aio/__init__.py | 23 - .../v2022_05_01_preview/aio/_configuration.py | 72 - .../aio/_edge_order_management_client.py | 113 - .../v2022_05_01_preview/aio/_patch.py | 20 - .../aio/operations/__init__.py | 27 - .../aio/operations/_addresses_operations.py | 951 ----- .../aio/operations/_operations.py | 140 - .../aio/operations/_order_items_operations.py | 1329 ------ .../aio/operations/_orders_operations.py | 324 -- .../aio/operations/_patch.py | 20 - ..._products_and_configurations_operations.py | 500 --- .../v2022_05_01_preview/models/__init__.py | 227 - .../_edge_order_management_client_enums.py | 343 -- .../v2022_05_01_preview/models/_models_py3.py | 3656 ---------------- .../v2022_05_01_preview/models/_patch.py | 20 - .../operations/__init__.py | 27 - .../operations/_addresses_operations.py | 1185 ------ .../operations/_operations.py | 164 - .../operations/_order_items_operations.py | 1644 -------- .../operations/_orders_operations.py | 431 -- .../v2022_05_01_preview/operations/_patch.py | 20 - ..._products_and_configurations_operations.py | 603 --- .../edgeorder/v2022_05_01_preview/py.typed | 1 - .../generated_samples/cancel_order_item.py | 4 +- .../generated_samples/create_address.py | 1 + .../generated_samples/create_order_item.py | 1 + .../delete_address_by_name.py | 4 +- .../delete_order_item_by_name.py | 4 +- .../generated_samples/get_address_by_name.py | 1 + .../generated_samples/get_order_by_name.py | 1 + .../get_order_item_by_name.py | 1 + .../list_addresses_at_resource_group_level.py | 1 + .../list_addresses_at_subscription_level.py | 1 + .../generated_samples/list_configurations.py | 1 + .../generated_samples/list_operations.py | 1 + .../list_order_at_resource_group_level.py | 1 + .../list_order_at_subscription_level.py | 1 + ...ist_order_items_at_resource_group_level.py | 1 + .../list_order_items_at_subscription_level.py | 1 + .../list_product_families.py | 1 + .../list_product_families_metadata.py | 1 + .../generated_samples/return_order_item.py | 4 +- .../generated_samples/update_address.py | 1 + .../generated_samples/update_order_item.py | 1 + .../generated_tests/conftest.py | 37 + .../test_edge_order_management.py | 526 +++ .../test_edge_order_management_async.py | 545 +++ .../azure-mgmt-edgeorder/sdk_packaging.toml | 2 +- sdk/edgeorder/azure-mgmt-edgeorder/setup.py | 86 +- 116 files changed, 2653 insertions(+), 28633 deletions(-) delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_operations_mixin.py rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2020_12_01_preview => }/_patch.py (100%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2021_12_01/aio => }/_vendor.py (81%) delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_operations_mixin.py rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2020_12_01_preview => }/aio/_patch.py (100%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2020_12_01_preview => }/aio/_vendor.py (89%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2020_12_01_preview => }/aio/operations/__init__.py (100%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2021_12_01 => }/aio/operations/_edge_order_management_client_operations.py (68%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2020_12_01_preview => }/aio/operations/_patch.py (100%) delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models.py rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2021_12_01 => }/models/__init__.py (100%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2021_12_01 => }/models/_edge_order_management_client_enums.py (99%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2021_12_01 => }/models/_models_py3.py (85%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2020_12_01_preview => }/models/_patch.py (100%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2020_12_01_preview => }/operations/__init__.py (100%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2021_12_01 => }/operations/_edge_order_management_client_operations.py (72%) rename sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/{v2020_12_01_preview => }/operations/_patch.py (100%) delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_configuration.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_edge_order_management_client.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_metadata.json delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_vendor.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_version.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_configuration.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_edge_order_management_client.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_edge_order_management_client_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_edge_order_management_client_enums.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_edge_order_management_client_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/py.typed delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_configuration.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_edge_order_management_client.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_metadata.json delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_vendor.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_version.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_configuration.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_edge_order_management_client.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/py.typed delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_configuration.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_edge_order_management_client.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_metadata.json delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_vendor.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_version.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_configuration.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_edge_order_management_client.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_addresses_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_order_items_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_orders_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_products_and_configurations_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_edge_order_management_client_enums.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_models_py3.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/__init__.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_addresses_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_order_items_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_orders_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_patch.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_products_and_configurations_operations.py delete mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/py.typed create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/conftest.py create 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_async.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md index 37cd2965d9e7..dc7f59953bf4 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md +++ b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md @@ -1,5 +1,48 @@ # Release History +## 2.0.0 (2024-10-30) + +### Features Added + + - Enum `LengthHeightUnit` added member `IN` + - Method `EdgeOrderManagementClient.begin_create_address` has a new overload `def begin_create_address(self: None, address_name: str, resource_group_name: str, address_resource: AddressResource, content_type: str)` + - Method `EdgeOrderManagementClient.begin_create_address` has a new overload `def begin_create_address(self: None, address_name: str, resource_group_name: str, address_resource: IO[bytes], content_type: str)` + - Method `EdgeOrderManagementClient.begin_create_order_item` has a new overload `def begin_create_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_resource: OrderItemResource, content_type: str)` + - Method `EdgeOrderManagementClient.begin_create_order_item` has a new overload `def begin_create_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_resource: IO[bytes], content_type: str)` + - Method `EdgeOrderManagementClient.begin_return_order_item` has a new overload `def begin_return_order_item(self: None, order_item_name: str, resource_group_name: str, return_order_item_details: ReturnOrderItemDetails, content_type: str)` + - Method `EdgeOrderManagementClient.begin_return_order_item` has a new overload `def begin_return_order_item(self: None, order_item_name: str, resource_group_name: str, return_order_item_details: IO[bytes], content_type: str)` + - Method `EdgeOrderManagementClient.begin_update_address` has a new overload `def begin_update_address(self: None, address_name: str, resource_group_name: str, address_update_parameter: AddressUpdateParameter, if_match: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClient.begin_update_address` has a new overload `def begin_update_address(self: None, address_name: str, resource_group_name: str, address_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClient.begin_update_order_item` has a new overload `def begin_update_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_update_parameter: OrderItemUpdateParameter, if_match: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClient.begin_update_order_item` has a new overload `def begin_update_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClient.cancel_order_item` has a new overload `def cancel_order_item(self: None, order_item_name: str, resource_group_name: str, cancellation_reason: CancellationReason, content_type: str)` + - Method `EdgeOrderManagementClient.cancel_order_item` has a new overload `def cancel_order_item(self: None, order_item_name: str, resource_group_name: str, cancellation_reason: IO[bytes], content_type: str)` + - Method `EdgeOrderManagementClient.list_configurations` has a new overload `def list_configurations(self: None, configurations_request: ConfigurationsRequest, skip_token: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClient.list_configurations` has a new overload `def list_configurations(self: None, configurations_request: IO[bytes], skip_token: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClient.list_product_families` has a new overload `def list_product_families(self: None, product_families_request: ProductFamiliesRequest, expand: Optional[str], skip_token: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClient.list_product_families` has a new overload `def list_product_families(self: None, product_families_request: IO[bytes], expand: Optional[str], skip_token: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_create_address` has a new overload `def begin_create_address(self: None, address_name: str, resource_group_name: str, address_resource: AddressResource, content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_create_address` has a new overload `def begin_create_address(self: None, address_name: str, resource_group_name: str, address_resource: IO[bytes], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_create_order_item` has a new overload `def begin_create_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_resource: OrderItemResource, content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_create_order_item` has a new overload `def begin_create_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_resource: IO[bytes], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_return_order_item` has a new overload `def begin_return_order_item(self: None, order_item_name: str, resource_group_name: str, return_order_item_details: ReturnOrderItemDetails, content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_return_order_item` has a new overload `def begin_return_order_item(self: None, order_item_name: str, resource_group_name: str, return_order_item_details: IO[bytes], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_update_address` has a new overload `def begin_update_address(self: None, address_name: str, resource_group_name: str, address_update_parameter: AddressUpdateParameter, if_match: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_update_address` has a new overload `def begin_update_address(self: None, address_name: str, resource_group_name: str, address_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_update_order_item` has a new overload `def begin_update_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_update_parameter: OrderItemUpdateParameter, if_match: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.begin_update_order_item` has a new overload `def begin_update_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.cancel_order_item` has a new overload `def cancel_order_item(self: None, order_item_name: str, resource_group_name: str, cancellation_reason: CancellationReason, content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.cancel_order_item` has a new overload `def cancel_order_item(self: None, order_item_name: str, resource_group_name: str, cancellation_reason: IO[bytes], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.list_configurations` has a new overload `def list_configurations(self: None, configurations_request: ConfigurationsRequest, skip_token: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.list_configurations` has a new overload `def list_configurations(self: None, configurations_request: IO[bytes], skip_token: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.list_product_families` has a new overload `def list_product_families(self: None, product_families_request: ProductFamiliesRequest, expand: Optional[str], skip_token: Optional[str], content_type: str)` + - Method `EdgeOrderManagementClientOperationsMixin.list_product_families` has a new overload `def list_product_families(self: None, product_families_request: IO[bytes], expand: Optional[str], skip_token: Optional[str], content_type: str)` + +### Breaking Changes + + - Method `EdgeOrderManagementClient.__init__` parameter `base_url` changed default value from `None` to `str` + - Deleted or renamed enum value `LengthHeightUnit.IN_ENUM` + ## 2.0.0b1 (2023-02-13) ### Features Added diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/README.md b/sdk/edgeorder/azure-mgmt-edgeorder/README.md index 8d315d6c29de..e82b1e4d3eda 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.7+. +This package has been tested with Python 3.8+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.7+ is required to use this package. +- Python 3.8+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -45,8 +45,9 @@ client = EdgeOrderManagementClient(credential=DefaultAzureCredential(), subscrip ## Examples - -Code samples for this package can be found at [Edge Order Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) +Code samples for this package can be found at: +- [Search Edge Order Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com +- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) ## Troubleshooting @@ -58,6 +59,3 @@ Code samples for this package can be found at [Edge Order Management](https://do If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-edgeorder%2FREADME.png) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json b/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json index 9be5bd944afa..6164984b1858 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json +++ b/sdk/edgeorder/azure-mgmt-edgeorder/_meta.json @@ -1,11 +1,11 @@ { - "commit": "ba733cb319d327bae00886c47975d624145834b0", + "commit": "2776cb32cd6ca9ea953a13ae26c954b989e83367", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.10.2", "use": [ - "@autorest/python@6.4.0", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.19.0", + "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/edgeorder/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "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/azure/mgmt/edgeorder/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/__init__.py index f8c8f5232d6b..cf345f5e5ed1 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/__init__.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/__init__.py @@ -7,14 +7,20 @@ # -------------------------------------------------------------------------- from ._edge_order_management_client import EdgeOrderManagementClient -__all__ = ['EdgeOrderManagementClient'] +from ._version import VERSION + +__version__ = VERSION try: - from ._patch import patch_sdk # type: ignore - patch_sdk() + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: - pass + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk -from ._version import VERSION +__all__ = [ + "EdgeOrderManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) -__version__ = VERSION +_patch_sdk() 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 aa76ce99a726..1c28307f38a0 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_configuration.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_configuration.py @@ -1,16 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- + from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -20,7 +17,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class EdgeOrderManagementClientConfiguration(Configuration): + +class EdgeOrderManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for EdgeOrderManagementClient. Note that all parameters used to create this instance are saved as instance @@ -30,38 +28,38 @@ class EdgeOrderManagementClientConfiguration(Configuration): :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-12-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - **kwargs: Any - ): + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2021-12-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-edgeorder/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ): - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py index bd98f0c74a78..9c115640d3b2 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_edge_order_management_client.py @@ -1,181 +1,111 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, TYPE_CHECKING +from typing_extensions import Self +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from . import models as _models from ._configuration import EdgeOrderManagementClientConfiguration -from ._operations_mixin import EdgeOrderManagementClientOperationsMixin 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 _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass -class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): +class EdgeOrderManagementClient( + EdgeOrderManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword """The EdgeOrder Client. - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - :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 api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param base_url: Service URL + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword api_version: Api Version. Default value is "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. """ - DEFAULT_API_VERSION = '2021-12-01' - _PROFILE_TAG = "azure.mgmt.edgeorder.EdgeOrderManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - }}, - _PROFILE_TAG + " latest" - ) - def __init__( self, credential: "TokenCredential", subscription_id: str, - api_version: Optional[str]=None, base_url: str = "https://management.azure.com", - profile: KnownProfiles=KnownProfiles.default, **kwargs: Any - ): - self._config = EdgeOrderManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(EdgeOrderManagementClient, self).__init__( - api_version=api_version, - profile=profile + ) -> 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 + """ - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - * 2020-12-01-preview: :mod:`v2020_12_01_preview.models` - * 2021-12-01: :mod:`v2021_12_01.models` - * 2022-05-01-preview: :mod:`v2022_05_01_preview.models` - """ - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview import models - return models - elif api_version == '2021-12-01': - from .v2021_12_01 import models - return models - elif api_version == '2022-05-01-preview': - from .v2022_05_01_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def addresses(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`AddressesOperations` - """ - api_version = self._get_api_version('addresses') - if api_version == '2022-05-01-preview': - from .v2022_05_01_preview.operations import AddressesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'addresses'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def operations(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2022-05-01-preview': - from .v2022_05_01_preview.operations import Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def order_items(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`OrderItemsOperations` - """ - api_version = self._get_api_version('order_items') - if api_version == '2022-05-01-preview': - from .v2022_05_01_preview.operations import OrderItemsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'order_items'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def orders(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`OrdersOperations` - """ - api_version = self._get_api_version('orders') - if api_version == '2022-05-01-preview': - from .v2022_05_01_preview.operations import OrdersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'orders'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def products_and_configurations(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`ProductsAndConfigurationsOperations` - """ - api_version = self._get_api_version('products_and_configurations') - if api_version == '2022-05-01-preview': - from .v2022_05_01_preview.operations import ProductsAndConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'products_and_configurations'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - def close(self): + def close(self) -> None: self._client.close() - def __enter__(self): + + def __enter__(self) -> Self: self._client.__enter__() return self - def __exit__(self, *exc_details): + + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_operations_mixin.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_operations_mixin.py deleted file mode 100644 index eb12d2f833cc..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_operations_mixin.py +++ /dev/null @@ -1,895 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -from ._serialization import Serializer, Deserializer -from typing import Any, IO, Iterable, Optional, Union - -from azure.core.paging import ItemPaged -from azure.core.polling import LROPoller - -from . import models as _models - - -class EdgeOrderManagementClientOperationsMixin(object): - - def begin_create_address( - self, - address_name: str, - resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address can be updated with this - API. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_resource: Address details from request body. Is either a AddressResource type or - a IO type. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_create_address') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_create_address'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_create_address(address_name, resource_group_name, address_resource, **kwargs) - - def begin_create_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Creates an order item. Existing order item cannot be updated with this api and should instead - be updated with the Update order item API. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_resource: Order item details from request body. Is either a OrderItemResource - type or a IO type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_create_order_item') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_create_order_item'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_create_order_item(order_item_name, resource_group_name, order_item_resource, **kwargs) - - def begin_delete_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes an address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_delete_address_by_name') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_delete_address_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_delete_address_by_name(address_name, resource_group_name, **kwargs) - - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_delete_order_item_by_name') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_delete_order_item_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_delete_order_item_by_name(order_item_name, resource_group_name, **kwargs) - - def begin_return_order_item( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> LROPoller[None]: - """Return order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. Is either a - ReturnOrderItemDetails type or a IO type. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_return_order_item') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_return_order_item'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_return_order_item(order_item_name, resource_group_name, return_order_item_details, **kwargs) - - def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Updates the properties of an existing address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. Is either a - AddressUpdateParameter type or a IO type. Required. - :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter - or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_update_address') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_update_address'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_update_address(address_name, resource_group_name, address_update_parameter, if_match, **kwargs) - - def begin_update_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. Is either a - OrderItemUpdateParameter type or a IO type. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_update_order_item') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_update_order_item'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.begin_update_order_item(order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs) - - def cancel_order_item( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **kwargs: Any - ) -> None: - """Cancel order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('cancel_order_item') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'cancel_order_item'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.cancel_order_item(order_item_name, resource_group_name, cancellation_reason, **kwargs) - - def get_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any - ) -> _models.AddressResource: - """Gets information about the specified address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('get_address_by_name') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'get_address_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.get_address_by_name(address_name, resource_group_name, **kwargs) - - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('get_order_by_name') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'get_order_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.get_order_by_name(order_name, resource_group_name, location, **kwargs) - - def get_order_item_by_name( - self, - order_item_name: str, - resource_group_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.OrderItemResource: - """Gets an order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param expand: $expand is supported on device details, forward shipping details and reverse - shipping details parameters. Each of these can be provided as a comma separated list. Device - Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. Default value is - None. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('get_order_item_by_name') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'get_order_item_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.get_order_item_by_name(order_item_name, resource_group_name, expand, **kwargs) - - 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. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. Default value is None. - :type filter: str - :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of address. Default value is None. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_addresses_at_resource_group_level') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_addresses_at_resource_group_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_addresses_at_resource_group_level(resource_group_name, filter, skip_token, **kwargs) - - 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. - - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_addresses_at_subscription_level') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_addresses_at_subscription_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_addresses_at_subscription_level(filter, skip_token, **kwargs) - - def list_configurations( - self, - configurations_request: Union[_models.ConfigurationsRequest, IO], - skip_token: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.Configuration"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. - - :param configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO type. Required. - :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or - IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_configurations') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_configurations'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_configurations(configurations_request, skip_token, **kwargs) - - def list_operations( - self, - **kwargs: Any - ) -> Iterable["_models.Operation"]: - """This method gets all the operations that are exposed for customer. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_operations') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_operations'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_operations(**kwargs) - - 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. - - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_order_at_resource_group_level') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_order_at_resource_group_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_order_at_resource_group_level(resource_group_name, skip_token, **kwargs) - - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_order_at_subscription_level') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_order_at_subscription_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_order_at_subscription_level(skip_token, **kwargs) - - def list_order_items_at_resource_group_level( - self, - resource_group_name: str, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.OrderItemResource"]: - """Lists order item at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_order_items_at_resource_group_level') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_order_items_at_resource_group_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_order_items_at_resource_group_level(resource_group_name, filter, expand, skip_token, **kwargs) - - def list_order_items_at_subscription_level( - self, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.OrderItemResource"]: - """Lists order item at subscription level. - - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_order_items_at_subscription_level') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_order_items_at_subscription_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_order_items_at_subscription_level(filter, expand, skip_token, **kwargs) - - def list_product_families( - self, - product_families_request: Union[_models.ProductFamiliesRequest, IO], - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.ProductFamily"]: - """This method provides the list of product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Is either a - ProductFamiliesRequest type or a IO type. Required. - :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest - or IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_product_families') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_product_families'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_product_families(product_families_request, expand, skip_token, **kwargs) - - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_product_families_metadata') - if api_version == '2020-12-01-preview': - from .v2020_12_01_preview.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from .v2021_12_01.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_product_families_metadata'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_product_families_metadata(skip_token, **kwargs) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_patch.py similarity index 100% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_patch.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_patch.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py index 25467dfc00bb..8139854b97bb 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_serialization.py @@ -63,8 +63,8 @@ import isodate # type: ignore -from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback -from azure.core.serialization import NULL as AzureCoreNull +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") @@ -124,7 +124,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: pass return ET.fromstring(data_as_str) # nosec - except ET.ParseError: + except ET.ParseError as err: # It might be because the server has an issue, and returned JSON with # content-type XML.... # So let's try a JSON load, and if it's still broken @@ -143,7 +143,9 @@ def _json_attemp(data): # The function hack is because Py2.7 messes up with exception # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") - raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod @@ -170,13 +172,6 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], return None -try: - basestring # type: ignore - unicode_str = unicode # type: ignore -except NameError: - basestring = str - unicode_str = str - _LOGGER = logging.getLogger(__name__) try: @@ -295,7 +290,7 @@ class Model(object): _validation: Dict[str, Dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Dict[str, Any] = {} + self.additional_properties: Optional[Dict[str, Any]] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -340,7 +335,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: - """Return the JSON that would be sent to azure from this model. + """Return the JSON that would be sent to server from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -351,14 +346,12 @@ 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) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[ - [str, Dict[str, Any], Any], Any - ] = attribute_transformer, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -392,7 +385,7 @@ def my_key_transformer(key, attr_desc, value): :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore @classmethod def _infer_class_models(cls): @@ -417,7 +410,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( @@ -447,7 +440,7 @@ def from_dict( if key_extractors is None else key_extractors ) - return deserializer(cls.__name__, data, content_type=content_type) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def _flatten_subtype(cls, key, objects): @@ -547,7 +540,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): + def __init__(self, classes: Optional[Mapping[str, type]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -563,7 +556,7 @@ def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.dependencies: Dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -631,7 +624,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): @@ -651,7 +644,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) - local_node.text = unicode_str(new_attr) + local_node.text = str(new_attr) serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore @@ -664,12 +657,13 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) - raise_with_traceback(SerializationError, msg, err) + raise SerializationError(msg) from err else: return serialized @@ -711,7 +705,7 @@ def body(self, data, data_type, **kwargs): ] data = deserializer._deserialize(data_type, data) except DeserializationError as err: - raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) + raise SerializationError("Unable to build a model: " + str(err)) from err return self._serialize(data, data_type, **kwargs) @@ -731,6 +725,7 @@ def url(self, name, data, data_type, **kwargs): if kwargs.get("skip_quote") is True: output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") except SerializationError: @@ -743,7 +738,9 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. - :rtype: str + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. + :rtype: str, list :raises: TypeError if serialization fails. :raises: ValueError if data is None """ @@ -751,10 +748,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -805,7 +800,7 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: - if data is AzureCoreNull: + if data is CoreNull: return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -825,7 +820,7 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." - raise_with_traceback(SerializationError, msg.format(data, data_type), err) + raise SerializationError(msg.format(data, data_type)) from err else: return self._serialize(data, **kwargs) @@ -893,6 +888,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +902,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +954,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: @@ -985,7 +989,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) if obj_type is _long_type: return self.serialize_long(attr) - if obj_type is unicode_str: + if obj_type is str: return self.serialize_unicode(attr) if obj_type is datetime.datetime: return self.serialize_iso(attr) @@ -1162,10 +1166,10 @@ def serialize_iso(attr, **kwargs): return date + microseconds + "Z" except (ValueError, OverflowError) as err: msg = "Unable to serialize datetime object." - raise_with_traceback(SerializationError, msg, err) + raise SerializationError(msg) from err except AttributeError as err: msg = "ISO-8601 object must be valid Datetime object." - raise_with_traceback(TypeError, msg, err) + raise TypeError(msg) from err @staticmethod def serialize_unix(attr, **kwargs): @@ -1201,7 +1205,6 @@ def rest_key_extractor(attr, attr_desc, data): if working_data is None: # If at any point while following flatten JSON path see None, it means # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) @@ -1222,7 +1225,6 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): if working_data is None: # If at any point while following flatten JSON path see None, it means # that all properties under are None as well - # https://github.com/Azure/msrest-for-python/issues/197 return None key = ".".join(dict_keys[1:]) @@ -1273,7 +1275,7 @@ def _extract_name_from_internal_type(internal_type): xml_name = internal_type_xml_map.get("name", internal_type.__name__) xml_ns = internal_type_xml_map.get("ns", None) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1297,7 +1299,7 @@ def xml_key_extractor(attr, attr_desc, data): # Integrate namespace if necessary xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): @@ -1363,7 +1365,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): + def __init__(self, classes: Optional[Mapping[str, type]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1383,7 +1385,7 @@ def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]]=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.dependencies: Dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1436,12 +1438,12 @@ def _deserialize(self, target_obj, data): response, class_name = self._classify_target(target_obj, data) - if isinstance(response, basestring): + if isinstance(response, str): return self.deserialize_data(data, response) elif isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) - if data is None: + if data is None or data is CoreNull: return data try: attributes = response._attribute_map # type: ignore @@ -1473,7 +1475,7 @@ def _deserialize(self, target_obj, data): d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: additional_properties = self._build_additional_properties(attributes, data) return self._instantiate_model(response, d_attrs, additional_properties) @@ -1507,14 +1509,14 @@ def _classify_target(self, target, data): if target is None: return None, None - if isinstance(target, basestring): + if isinstance(target, str): try: target = self.dependencies[target] except KeyError: return target, target try: - target = target._classify(data, self.dependencies) + target = target._classify(data, self.dependencies) # type: ignore except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1570,7 +1572,7 @@ def _unpack_content(raw_data, content_type=None): if hasattr(raw_data, "_content_consumed"): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data @@ -1644,7 +1646,7 @@ def deserialize_data(self, data, data_type): except (ValueError, TypeError, AttributeError) as err: msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return self._deserialize(obj_type, data) @@ -1692,7 +1694,7 @@ def deserialize_object(self, attr, **kwargs): if isinstance(attr, ET.Element): # Do no recurse on XML, just return the tree as-is return attr - if isinstance(attr, basestring): + if isinstance(attr, str): return self.deserialize_basic(attr, "str") obj_type = type(attr) if obj_type in self.basic_types: @@ -1749,7 +1751,7 @@ def deserialize_basic(self, attr, data_type): if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, basestring): + elif isinstance(attr, str): if attr.lower() in ["true", "1"]: return True elif attr.lower() in ["false", "0"]: @@ -1800,7 +1802,6 @@ def deserialize_enum(data, enum_obj): data = data.value if isinstance(data, int): # Workaround. We might consider remove it in the future. - # https://github.com/Azure/azure-rest-api-specs/issues/141 try: return list(enum_obj.__members__.values())[data] except IndexError: @@ -1854,10 +1855,10 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) # type: ignore + return decimal.Decimal(str(attr)) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err @staticmethod def deserialize_long(attr): @@ -1885,7 +1886,7 @@ def deserialize_duration(attr): duration = isodate.parse_duration(attr) except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return duration @@ -1902,7 +1903,7 @@ def deserialize_date(attr): if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) @staticmethod def deserialize_time(attr): @@ -1937,7 +1938,7 @@ def deserialize_rfc(attr): date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj @@ -1974,7 +1975,7 @@ def deserialize_iso(attr): raise OverflowError("Hit max or min date") except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj @@ -1990,9 +1991,10 @@ def deserialize_unix(attr): if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore try: + attr = int(attr) date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: msg = "Cannot deserialize to unix datetime object." - raise_with_traceback(DeserializationError, msg, err) + raise DeserializationError(msg) from err else: return date_obj diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_vendor.py similarity index 81% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_vendor.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_vendor.py index 0c61995427f8..97de9394b7bd 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_vendor.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_vendor.py @@ -8,21 +8,19 @@ from abc import ABC from typing import TYPE_CHECKING -from azure.core.pipeline.transport import HttpRequest - from ._configuration import EdgeOrderManagementClientConfiguration if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from azure.core import AsyncPipelineClient + from azure.core import PipelineClient - from ..._serialization import Deserializer, Serializer + from ._serialization import Deserializer, Serializer class EdgeOrderManagementClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" - _client: "AsyncPipelineClient" + _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 e32dc6ec4218..48944bf3938a 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_version.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0b1" +VERSION = "2.0.0" 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 b8c98d8145e8..b9eec9b0ea44 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 @@ -7,4 +7,17 @@ # -------------------------------------------------------------------------- from ._edge_order_management_client import EdgeOrderManagementClient -__all__ = ['EdgeOrderManagementClient'] + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "EdgeOrderManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_configuration.py index 20c71c35d537..5adb2abf8fd7 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 @@ -1,16 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- + from typing import Any, TYPE_CHECKING -from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -20,7 +17,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class EdgeOrderManagementClientConfiguration(Configuration): + +class EdgeOrderManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long """Configuration for EdgeOrderManagementClient. Note that all parameters used to create this instance are saved as instance @@ -30,38 +28,38 @@ class EdgeOrderManagementClientConfiguration(Configuration): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-12-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2021-12-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-mgmt-edgeorder/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py index fbc912c1611a..e38b3d3a311c 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_edge_order_management_client.py @@ -1,181 +1,113 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING +from typing_extensions import Self +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from .. import models as _models from .._serialization import Deserializer, Serializer from ._configuration import EdgeOrderManagementClientConfiguration -from ._operations_mixin import EdgeOrderManagementClientOperationsMixin +from .operations import EdgeOrderManagementClientOperationsMixin if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass -class EdgeOrderManagementClient(EdgeOrderManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): +class EdgeOrderManagementClient( + EdgeOrderManagementClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword """The EdgeOrder Client. - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - :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 api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param base_url: Service URL + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword api_version: Api Version. Default value is "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. """ - DEFAULT_API_VERSION = '2021-12-01' - _PROFILE_TAG = "azure.mgmt.edgeorder.EdgeOrderManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - }}, - _PROFILE_TAG + " latest" - ) - def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - api_version: Optional[str] = None, base_url: str = "https://management.azure.com", - profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: - self._config = EdgeOrderManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(EdgeOrderManagementClient, self).__init__( - api_version=api_version, - profile=profile + 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 + """ - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - * 2020-12-01-preview: :mod:`v2020_12_01_preview.models` - * 2021-12-01: :mod:`v2021_12_01.models` - * 2022-05-01-preview: :mod:`v2022_05_01_preview.models` - """ - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview import models - return models - elif api_version == '2021-12-01': - from ..v2021_12_01 import models - return models - elif api_version == '2022-05-01-preview': - from ..v2022_05_01_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def addresses(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`AddressesOperations` - """ - api_version = self._get_api_version('addresses') - if api_version == '2022-05-01-preview': - from ..v2022_05_01_preview.aio.operations import AddressesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'addresses'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def operations(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2022-05-01-preview': - from ..v2022_05_01_preview.aio.operations import Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def order_items(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`OrderItemsOperations` - """ - api_version = self._get_api_version('order_items') - if api_version == '2022-05-01-preview': - from ..v2022_05_01_preview.aio.operations import OrderItemsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'order_items'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def orders(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`OrdersOperations` - """ - api_version = self._get_api_version('orders') - if api_version == '2022-05-01-preview': - from ..v2022_05_01_preview.aio.operations import OrdersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'orders'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def products_and_configurations(self): - """Instance depends on the API version: - - * 2022-05-01-preview: :class:`ProductsAndConfigurationsOperations` - """ - api_version = self._get_api_version('products_and_configurations') - if api_version == '2022-05-01-preview': - from ..v2022_05_01_preview.aio.operations import ProductsAndConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'products_and_configurations'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - async def close(self): + async def close(self) -> None: await self._client.close() - async def __aenter__(self): + + async def __aenter__(self) -> Self: await self._client.__aenter__() return self - async def __aexit__(self, *exc_details): + + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_operations_mixin.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_operations_mixin.py deleted file mode 100644 index 5f6d25173fa2..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_operations_mixin.py +++ /dev/null @@ -1,904 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- -from .._serialization import Serializer, Deserializer -from typing import Any, AsyncIterable, IO, Optional, Union - -from azure.core.async_paging import AsyncItemPaged -from azure.core.polling import AsyncLROPoller - -from .. import models as _models - - -class EdgeOrderManagementClientOperationsMixin(object): - - async def begin_create_address( - self, - address_name: str, - resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address can be updated with this - API. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_resource: Address details from request body. Is either a AddressResource type or - a IO type. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_create_address') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_create_address'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.begin_create_address(address_name, resource_group_name, address_resource, **kwargs) - - async def begin_create_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Creates an order item. Existing order item cannot be updated with this api and should instead - be updated with the Update order item API. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_resource: Order item details from request body. Is either a OrderItemResource - type or a IO type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_create_order_item') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_create_order_item'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.begin_create_order_item(order_item_name, resource_group_name, order_item_resource, **kwargs) - - async def begin_delete_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_delete_address_by_name') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_delete_address_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.begin_delete_address_by_name(address_name, resource_group_name, **kwargs) - - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_delete_order_item_by_name') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_delete_order_item_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.begin_delete_order_item_by_name(order_item_name, resource_group_name, **kwargs) - - async def begin_return_order_item( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. Is either a - ReturnOrderItemDetails type or a IO type. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_return_order_item') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_return_order_item'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.begin_return_order_item(order_item_name, resource_group_name, return_order_item_details, **kwargs) - - async def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Updates the properties of an existing address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. Is either a - AddressUpdateParameter type or a IO type. Required. - :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter - or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_update_address') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_update_address'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.begin_update_address(address_name, resource_group_name, address_update_parameter, if_match, **kwargs) - - async def begin_update_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. Is either a - OrderItemUpdateParameter type or a IO type. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('begin_update_order_item') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'begin_update_order_item'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.begin_update_order_item(order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs) - - async def cancel_order_item( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **kwargs: Any - ) -> None: - """Cancel order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('cancel_order_item') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'cancel_order_item'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.cancel_order_item(order_item_name, resource_group_name, cancellation_reason, **kwargs) - - async def get_address_by_name( - self, - address_name: str, - resource_group_name: str, - **kwargs: Any - ) -> _models.AddressResource: - """Gets information about the specified address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('get_address_by_name') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'get_address_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.get_address_by_name(address_name, resource_group_name, **kwargs) - - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('get_order_by_name') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'get_order_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.get_order_by_name(order_name, resource_group_name, location, **kwargs) - - async def get_order_item_by_name( - self, - order_item_name: str, - resource_group_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.OrderItemResource: - """Gets an order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param expand: $expand is supported on device details, forward shipping details and reverse - shipping details parameters. Each of these can be provided as a comma separated list. Device - Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. Default value is - None. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('get_order_item_by_name') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'get_order_item_by_name'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.get_order_item_by_name(order_item_name, resource_group_name, expand, **kwargs) - - 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. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. Default value is None. - :type filter: str - :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of address. Default value is None. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_addresses_at_resource_group_level') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_addresses_at_resource_group_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_addresses_at_resource_group_level(resource_group_name, filter, skip_token, **kwargs) - - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_addresses_at_subscription_level') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_addresses_at_subscription_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_addresses_at_subscription_level(filter, skip_token, **kwargs) - - def list_configurations( - self, - configurations_request: Union[_models.ConfigurationsRequest, IO], - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.Configuration"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. - - :param configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO type. Required. - :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or - IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_configurations') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_configurations'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_configurations(configurations_request, skip_token, **kwargs) - - def list_operations( - self, - **kwargs: Any - ) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations that are exposed for customer. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_operations') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_operations'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_operations(**kwargs) - - 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. - - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_order_at_resource_group_level') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_order_at_resource_group_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_order_at_resource_group_level(resource_group_name, skip_token, **kwargs) - - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_order_at_subscription_level') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_order_at_subscription_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_order_at_subscription_level(skip_token, **kwargs) - - def list_order_items_at_resource_group_level( - self, - resource_group_name: str, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResource"]: - """Lists order item at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_order_items_at_resource_group_level') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_order_items_at_resource_group_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_order_items_at_resource_group_level(resource_group_name, filter, expand, skip_token, **kwargs) - - def list_order_items_at_subscription_level( - self, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_order_items_at_subscription_level') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_order_items_at_subscription_level'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_order_items_at_subscription_level(filter, expand, skip_token, **kwargs) - - def list_product_families( - self, - product_families_request: Union[_models.ProductFamiliesRequest, IO], - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamily"]: - """This method provides the list of product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Is either a - ProductFamiliesRequest type or a IO type. Required. - :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest - or IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_product_families') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_product_families'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_product_families(product_families_request, expand, skip_token, **kwargs) - - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - api_version = self._get_api_version('list_product_families_metadata') - if api_version == '2020-12-01-preview': - from ..v2020_12_01_preview.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - elif api_version == '2021-12-01': - from ..v2021_12_01.aio.operations import EdgeOrderManagementClientOperationsMixin as OperationClass - else: - raise ValueError("API version {} does not have operation 'list_product_families_metadata'".format(api_version)) - mixin_instance = OperationClass() - mixin_instance._client = self._client - mixin_instance._config = self._config - mixin_instance._config.api_version = api_version - mixin_instance._serialize = Serializer(self._models_dict(api_version)) - mixin_instance._serialize.client_side_validation = False - mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return mixin_instance.list_product_families_metadata(skip_token, **kwargs) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_patch.py similarity index 100% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_patch.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_patch.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_vendor.py similarity index 89% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_vendor.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_vendor.py index 0c61995427f8..ed13e1b40b7d 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_vendor.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/_vendor.py @@ -8,15 +8,13 @@ from abc import ABC from typing import TYPE_CHECKING -from azure.core.pipeline.transport import HttpRequest - from ._configuration import EdgeOrderManagementClientConfiguration if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core import AsyncPipelineClient - from ..._serialization import Deserializer, Serializer + from .._serialization import Deserializer, Serializer class EdgeOrderManagementClientMixinABC(ABC): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/__init__.py similarity index 100% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/__init__.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/__init__.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_edge_order_management_client_operations.py similarity index 68% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_edge_order_management_client_operations.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_edge_order_management_client_operations.py index 161c6f585578..0bfa17afc009 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_edge_order_management_client_operations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_edge_order_management_client_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -17,12 +18,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict @@ -30,7 +32,6 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request from ...operations._edge_order_management_client_operations import ( build_cancel_order_item_request, build_create_address_request, @@ -56,34 +57,33 @@ ) from .._vendor import EdgeOrderManagementClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class EdgeOrderManagementClientOperationsMixin( +class EdgeOrderManagementClientOperationsMixin( # pylint: disable=too-many-public-methods EdgeOrderManagementClientMixinABC -): # pylint: disable=too-many-public-methods +): + @distributed_trace def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """This method gets all the operations that are exposed for customer. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -94,14 +94,12 @@ def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - request = build_list_operations_request( + _request = build_list_operations_request( api_version=api_version, - template_url=self.list_operations.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -113,13 +111,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) @@ -129,10 +126,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -145,8 +143,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_operations.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} - @distributed_trace def list_addresses_at_subscription_level( self, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any @@ -159,19 +155,17 @@ def list_addresses_at_subscription_level( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,17 +176,15 @@ def list_addresses_at_subscription_level( def prepare_request(next_link=None): if not next_link: - request = build_list_addresses_at_subscription_level_request( + _request = build_list_addresses_at_subscription_level_request( subscription_id=self._config.subscription_id, filter=filter, skip_token=skip_token, api_version=api_version, - template_url=self.list_addresses_at_subscription_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -204,13 +196,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AddressResourceList", pipeline_response) @@ -220,10 +211,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -236,10 +228,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_addresses_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses" - } - @overload def list_product_families( self, @@ -253,7 +241,7 @@ def list_product_families( """This method provides the list of product families for the given subscription. :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest + :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 @@ -263,17 +251,15 @@ def list_product_families( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ @overload def list_product_families( self, - product_families_request: IO, + product_families_request: IO[bytes], expand: Optional[str] = None, skip_token: Optional[str] = None, *, @@ -283,7 +269,7 @@ def list_product_families( """This method provides the list of product families for the given subscription. :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: IO + :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 @@ -293,17 +279,15 @@ def list_product_families( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def list_product_families( self, - product_families_request: Union[_models.ProductFamiliesRequest, IO], + product_families_request: Union[_models.ProductFamiliesRequest, IO[bytes]], expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any @@ -311,32 +295,27 @@ def list_product_families( """This method provides the list of product families for the given subscription. :param product_families_request: Filters for showing the product families. Is either a - ProductFamiliesRequest type or a IO type. Required. - :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest - or IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -346,7 +325,7 @@ def list_product_families( content_type = content_type or "application/json" _json = None _content = None - if isinstance(product_families_request, (IO, bytes)): + if isinstance(product_families_request, (IOBase, bytes)): _content = product_families_request else: _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") @@ -354,7 +333,7 @@ def list_product_families( def prepare_request(next_link=None): if not next_link: - request = build_list_product_families_request( + _request = build_list_product_families_request( subscription_id=self._config.subscription_id, expand=expand, skip_token=skip_token, @@ -362,12 +341,10 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, content=_content, - template_url=self.list_product_families.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -379,13 +356,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ProductFamilies", pipeline_response) @@ -395,10 +371,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -411,10 +388,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_product_families.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" - } - @overload def list_configurations( self, @@ -428,24 +401,22 @@ def list_configurations( product under subscription. :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest + :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 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ @overload def list_configurations( self, - configurations_request: IO, + configurations_request: IO[bytes], skip_token: Optional[str] = None, *, content_type: str = "application/json", @@ -455,24 +426,22 @@ def list_configurations( product under subscription. :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: IO + :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. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def list_configurations( self, - configurations_request: Union[_models.ConfigurationsRequest, IO], + configurations_request: Union[_models.ConfigurationsRequest, IO[bytes]], skip_token: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.Configuration"]: @@ -480,29 +449,23 @@ def list_configurations( product under subscription. :param configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO type. Required. - :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or - IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +475,7 @@ def list_configurations( content_type = content_type or "application/json" _json = None _content = None - if isinstance(configurations_request, (IO, bytes)): + if isinstance(configurations_request, (IOBase, bytes)): _content = configurations_request else: _json = self._serialize.body(configurations_request, "ConfigurationsRequest") @@ -520,19 +483,17 @@ def list_configurations( def prepare_request(next_link=None): if not next_link: - request = build_list_configurations_request( + _request = build_list_configurations_request( subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.list_configurations.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -544,13 +505,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("Configurations", pipeline_response) @@ -560,10 +520,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -576,10 +537,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_configurations.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" - } - @distributed_trace def list_product_families_metadata( self, skip_token: Optional[str] = None, **kwargs: Any @@ -589,20 +546,19 @@ def list_product_families_metadata( :param skip_token: $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. Default value is None. :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.models.ProductFamiliesMetadataDetails] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,16 +569,14 @@ def list_product_families_metadata( def prepare_request(next_link=None): if not next_link: - request = build_list_product_families_metadata_request( + _request = build_list_product_families_metadata_request( subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, - template_url=self.list_product_families_metadata.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -634,13 +588,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) @@ -650,10 +603,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -666,10 +620,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_product_families_metadata.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" - } - @distributed_trace def list_order_at_subscription_level( self, skip_token: Optional[str] = None, **kwargs: Any @@ -679,19 +629,17 @@ def list_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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -702,16 +650,14 @@ def list_order_at_subscription_level( def prepare_request(next_link=None): if not next_link: - request = build_list_order_at_subscription_level_request( + _request = build_list_order_at_subscription_level_request( subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, - template_url=self.list_order_at_subscription_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -723,13 +669,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("OrderResourceList", pipeline_response) @@ -739,10 +684,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -755,10 +701,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_order_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders" - } - @distributed_trace def list_order_items_at_subscription_level( self, @@ -781,19 +723,17 @@ def list_order_items_at_subscription_level( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,18 +744,16 @@ 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_list_order_items_at_subscription_level_request( subscription_id=self._config.subscription_id, filter=filter, expand=expand, skip_token=skip_token, api_version=api_version, - template_url=self.list_order_items_at_subscription_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -827,13 +765,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("OrderItemResourceList", pipeline_response) @@ -843,10 +780,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -859,10 +797,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_order_items_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems" - } - @distributed_trace def list_addresses_at_resource_group_level( self, resource_group_name: str, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any @@ -878,19 +812,17 @@ def list_addresses_at_resource_group_level( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -901,18 +833,16 @@ 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( + _request = build_list_addresses_at_resource_group_level_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, filter=filter, skip_token=skip_token, api_version=api_version, - template_url=self.list_addresses_at_resource_group_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -924,13 +854,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("AddressResourceList", pipeline_response) @@ -940,10 +869,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -956,10 +886,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_addresses_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" - } - @distributed_trace_async async def get_address_by_name( self, address_name: str, resource_group_name: str, **kwargs: Any @@ -973,12 +899,11 @@ async def get_address_by_name( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource + :rtype: ~azure.mgmt.edgeorder.models.AddressResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -989,23 +914,22 @@ async def get_address_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - request = build_get_address_by_name_request( + _request = build_get_address_by_name_request( address_name=address_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_address_by_name.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1015,25 +939,21 @@ async def get_address_by_name( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AddressResource", pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_address_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return deserialized # type: ignore async def _create_address_initial( self, address_name: str, resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], + address_resource: Union[_models.AddressResource, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1044,19 +964,19 @@ async def _create_address_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(address_resource, (IO, bytes)): + if isinstance(address_resource, (IOBase, bytes)): _content = address_resource else: _json = self._serialize.body(address_resource, "AddressResource") - request = build_create_address_request( + _request = build_create_address_request( address_name=address_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -1064,36 +984,34 @@ async def _create_address_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_address_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _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) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - _create_address_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return deserialized # type: ignore @overload async def begin_create_address( @@ -1116,22 +1034,13 @@ async def begin_create_address( Required. :type resource_group_name: str :param address_resource: Address details from request body. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1140,7 +1049,7 @@ async def begin_create_address( self, address_name: str, resource_group_name: str, - address_resource: IO, + address_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1156,22 +1065,13 @@ async def begin_create_address( Required. :type resource_group_name: str :param address_resource: Address details from request body. Required. - :type address_resource: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1180,7 +1080,7 @@ async def begin_create_address( self, address_name: str, resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], + address_resource: Union[_models.AddressResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AddressResource]: """Creates a new address with the specified parameters. Existing address can be updated with this @@ -1194,29 +1094,17 @@ async def begin_create_address( Required. :type resource_group_name: str :param address_resource: Address details from request body. Is either a AddressResource type or - a IO type. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + 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.v2021_12_01.models.AddressResource] + :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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1234,12 +1122,13 @@ async def begin_create_address( 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("AddressResource", pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1249,22 +1138,20 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_address.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return AsyncLROPoller[_models.AddressResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements + async def _delete_address_by_name_initial( self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> None: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1275,38 +1162,42 @@ async def _delete_address_by_name_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - request = build_delete_address_by_name_request( + _request = build_delete_address_by_name_request( address_name=address_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_address_by_name_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _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 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) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - _delete_address_by_name_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return deserialized # type: ignore @distributed_trace_async async def begin_delete_address_by_name( @@ -1321,14 +1212,6 @@ async def begin_delete_address_by_name( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1336,13 +1219,13 @@ async def begin_delete_address_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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_address_by_name_initial( # type: ignore + raw_result = await self._delete_address_by_name_initial( address_name=address_name, resource_group_name=resource_group_name, api_version=api_version, @@ -1351,11 +1234,12 @@ async def begin_delete_address_by_name( 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, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1364,27 +1248,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_address_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return AsyncLROPoller[None](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], + address_update_parameter: Union[_models.AddressUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1395,19 +1275,19 @@ async def _update_address_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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[Optional[_models.AddressResource]] = kwargs.pop("cls", 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, (IO, bytes)): + 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( + _request = build_update_address_request( address_name=address_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -1416,36 +1296,34 @@ async def _update_address_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_address_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _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) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - _update_address_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return deserialized # type: ignore @overload async def begin_update_address( @@ -1468,25 +1346,16 @@ async def begin_update_address( Required. :type resource_group_name: str :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1495,7 +1364,7 @@ async def begin_update_address( self, address_name: str, resource_group_name: str, - address_update_parameter: IO, + address_update_parameter: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", @@ -1511,25 +1380,16 @@ async def begin_update_address( Required. :type resource_group_name: str :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1538,7 +1398,7 @@ async def begin_update_address( self, address_name: str, resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], + address_update_parameter: Union[_models.AddressUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> AsyncLROPoller[_models.AddressResource]: @@ -1552,33 +1412,21 @@ async def begin_update_address( Required. :type resource_group_name: str :param address_update_parameter: Address update parameters from request body. Is either a - AddressUpdateParameter type or a IO type. Required. - :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter - or IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either AddressResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1597,12 +1445,13 @@ async def begin_update_address( 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("AddressResource", pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1612,17 +1461,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_address.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return AsyncLROPoller[_models.AddressResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_order_at_resource_group_level( @@ -1636,19 +1483,17 @@ def list_order_at_resource_group_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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1659,17 +1504,15 @@ 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_list_order_at_resource_group_level_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, - template_url=self.list_order_at_resource_group_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1681,13 +1524,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("OrderResourceList", pipeline_response) @@ -1697,10 +1539,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1713,10 +1556,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_order_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" - } - @distributed_trace_async async def get_order_by_name( self, order_name: str, resource_group_name: str, location: str, **kwargs: Any @@ -1730,12 +1569,11 @@ async def get_order_by_name( :type resource_group_name: str :param location: The name of Azure region. Required. :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource + :rtype: ~azure.mgmt.edgeorder.models.OrderResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1746,24 +1584,23 @@ async def get_order_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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( + _request = build_get_order_by_name_request( order_name=order_name, resource_group_name=resource_group_name, location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_order_by_name.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1773,16 +1610,12 @@ async def get_order_by_name( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OrderResource", pipeline_response) + deserialized = self._deserialize("OrderResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get_order_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" - } + return deserialized # type: ignore @distributed_trace def list_order_items_at_resource_group_level( @@ -1810,19 +1643,17 @@ def list_order_items_at_resource_group_level( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1833,19 +1664,17 @@ 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( + _request = build_list_order_items_at_resource_group_level_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, filter=filter, expand=expand, skip_token=skip_token, api_version=api_version, - template_url=self.list_order_items_at_resource_group_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1857,13 +1686,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request async def extract_data(pipeline_response): deserialized = self._deserialize("OrderItemResourceList", pipeline_response) @@ -1873,10 +1701,11 @@ async def extract_data(pipeline_response): return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1889,10 +1718,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_order_items_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" - } - @distributed_trace_async async def get_order_item_by_name( self, order_item_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any @@ -1910,12 +1735,11 @@ async def get_order_item_by_name( Shipping details provide forward and reverse shipping details respectively. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource + :rtype: ~azure.mgmt.edgeorder.models.OrderItemResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1926,24 +1750,23 @@ async def get_order_item_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - request = build_get_order_item_by_name_request( + _request = build_get_order_item_by_name_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, expand=expand, api_version=api_version, - template_url=self.get_order_item_by_name.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1953,25 +1776,21 @@ async def get_order_item_by_name( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OrderItemResource", pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - get_order_item_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return deserialized # type: ignore async def _create_order_item_initial( self, order_item_name: str, resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], + order_item_resource: Union[_models.OrderItemResource, IO[bytes]], **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1982,19 +1801,19 @@ async def _create_order_item_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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[Optional[_models.OrderItemResource]] = kwargs.pop("cls", 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, (IO, bytes)): + if isinstance(order_item_resource, (IOBase, bytes)): _content = order_item_resource else: _json = self._serialize.body(order_item_resource, "OrderItemResource") - request = build_create_order_item_request( + _request = build_create_order_item_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -2002,36 +1821,34 @@ async def _create_order_item_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_order_item_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _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) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - _create_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return deserialized # type: ignore @overload async def begin_create_order_item( @@ -2052,22 +1869,13 @@ async def begin_create_order_item( Required. :type resource_group_name: str :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2076,7 +1884,7 @@ async def begin_create_order_item( self, order_item_name: str, resource_group_name: str, - order_item_resource: IO, + order_item_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2090,22 +1898,13 @@ async def begin_create_order_item( Required. :type resource_group_name: str :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2114,7 +1913,7 @@ async def begin_create_order_item( self, order_item_name: str, resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], + order_item_resource: Union[_models.OrderItemResource, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.OrderItemResource]: """Creates an order item. Existing order item cannot be updated with this api and should instead @@ -2126,29 +1925,17 @@ async def begin_create_order_item( Required. :type resource_group_name: str :param order_item_resource: Order item details from request body. Is either a OrderItemResource - type or a IO type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + 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.v2021_12_01.models.OrderItemResource] + :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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2166,12 +1953,13 @@ async def begin_create_order_item( 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) + deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2181,22 +1969,20 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return AsyncLROPoller[_models.OrderItemResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements + async def _delete_order_item_by_name_initial( self, order_item_name: str, resource_group_name: str, **kwargs: Any - ) -> None: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2207,38 +1993,42 @@ async def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - request = build_delete_order_item_by_name_request( + _request = build_delete_order_item_by_name_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_order_item_by_name_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _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 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) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - _delete_order_item_by_name_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return deserialized # type: ignore @distributed_trace_async async def begin_delete_order_item_by_name( @@ -2251,14 +2041,6 @@ async def begin_delete_order_item_by_name( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2266,13 +2048,13 @@ async def begin_delete_order_item_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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( # type: ignore + 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, @@ -2281,11 +2063,12 @@ async def begin_delete_order_item_by_name( 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, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2294,27 +2077,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_order_item_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _update_order_item_initial( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2325,19 +2104,19 @@ async def _update_order_item_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(order_item_update_parameter, (IO, bytes)): + if isinstance(order_item_update_parameter, (IOBase, bytes)): _content = order_item_update_parameter else: _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") - request = build_update_order_item_request( + _request = build_update_order_item_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -2346,36 +2125,34 @@ async def _update_order_item_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_order_item_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _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) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - _update_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return deserialized # type: ignore @overload async def begin_update_order_item( @@ -2396,26 +2173,16 @@ async def begin_update_order_item( 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.v2021_12_01.models.OrderItemUpdateParameter + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2424,7 +2191,7 @@ async def begin_update_order_item( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: IO, + order_item_update_parameter: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", @@ -2438,25 +2205,16 @@ async def begin_update_order_item( 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 + :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. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2465,7 +2223,7 @@ async def begin_update_order_item( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> AsyncLROPoller[_models.OrderItemResource]: @@ -2477,33 +2235,21 @@ async def begin_update_order_item( Required. :type resource_group_name: str :param order_item_update_parameter: order item update parameters from request body. Is either a - OrderItemUpdateParameter type or a IO type. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2522,12 +2268,13 @@ async def begin_update_order_item( 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) + deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2537,17 +2284,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + 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 @@ -2567,11 +2312,10 @@ async def cancel_order_item( # pylint: disable=inconsistent-return-statements Required. :type resource_group_name: str :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -2582,7 +2326,7 @@ async def cancel_order_item( # pylint: disable=inconsistent-return-statements self, order_item_name: str, resource_group_name: str, - cancellation_reason: IO, + cancellation_reason: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2595,11 +2339,10 @@ async def cancel_order_item( # pylint: disable=inconsistent-return-statements Required. :type resource_group_name: str :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -2610,7 +2353,7 @@ 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], + cancellation_reason: Union[_models.CancellationReason, IO[bytes]], **kwargs: Any ) -> None: """Cancel order item. @@ -2621,17 +2364,13 @@ async def cancel_order_item( # pylint: disable=inconsistent-return-statements Required. :type resource_group_name: str :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2642,19 +2381,19 @@ async def cancel_order_item( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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, (IO, bytes)): + if isinstance(cancellation_reason, (IOBase, bytes)): _content = cancellation_reason else: _json = self._serialize.body(cancellation_reason, "CancellationReason") - request = build_cancel_order_item_request( + _request = build_cancel_order_item_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -2662,15 +2401,14 @@ async def cancel_order_item( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self.cancel_order_item.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2681,20 +2419,16 @@ async def cancel_order_item( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, {}) # type: ignore - cancel_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" - } - - async def _return_order_item_initial( # pylint: disable=inconsistent-return-statements + async def _return_order_item_initial( self, order_item_name: str, resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO[bytes]], **kwargs: Any - ) -> None: - error_map = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2705,19 +2439,19 @@ async def _return_order_item_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(return_order_item_details, (IO, bytes)): + if isinstance(return_order_item_details, (IOBase, bytes)): _content = return_order_item_details else: _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") - request = build_return_order_item_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, @@ -2725,30 +2459,34 @@ async def _return_order_item_initial( # pylint: disable=inconsistent-return-sta content_type=content_type, json=_json, content=_content, - template_url=self._return_order_item_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _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) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - _return_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } + return deserialized # type: ignore @overload async def begin_return_order_item( @@ -2768,19 +2506,10 @@ async def begin_return_order_item( Required. :type resource_group_name: str :param return_order_item_details: Return order item CurrentStatus. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2791,7 +2520,7 @@ async def begin_return_order_item( self, order_item_name: str, resource_group_name: str, - return_order_item_details: IO, + return_order_item_details: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2804,18 +2533,10 @@ async def begin_return_order_item( Required. :type resource_group_name: str :param return_order_item_details: Return order item CurrentStatus. Required. - :type return_order_item_details: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2826,7 +2547,7 @@ async def begin_return_order_item( self, order_item_name: str, resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Return order item. @@ -2837,20 +2558,9 @@ async def begin_return_order_item( Required. :type resource_group_name: str :param return_order_item_details: Return order item CurrentStatus. Is either a - ReturnOrderItemDetails type or a IO type. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + 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] :raises ~azure.core.exceptions.HttpResponseError: @@ -2858,14 +2568,14 @@ async def begin_return_order_item( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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( # type: ignore + 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, @@ -2876,11 +2586,12 @@ async def begin_return_order_item( 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, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -2889,14 +2600,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_return_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_patch.py similarity index 100% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_patch.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/aio/operations/_patch.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models.py deleted file mode 100644 index 0d8ae70ba26c..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models.py +++ /dev/null @@ -1,7 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from .v2021_12_01.models import * diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/__init__.py similarity index 100% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/__init__.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/__init__.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_edge_order_management_client_enums.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_edge_order_management_client_enums.py similarity index 99% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_edge_order_management_client_enums.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_edge_order_management_client_enums.py index 08fee5827f42..e0ba5928071e 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_edge_order_management_client_enums.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_edge_order_management_client_enums.py @@ -113,7 +113,7 @@ class DisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Subscription does not have required offer types.""" NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" + notification.""" NOT_AVAILABLE = "NotAvailable" """The product is not yet available.""" OUT_OF_STOCK = "OutOfStock" @@ -149,6 +149,8 @@ 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): diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models_py3.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models_py3.py similarity index 85% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models_py3.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models_py3.py index f71d4263aeda..16c22ff72120 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_models_py3.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_models_py3.py @@ -10,7 +10,7 @@ import datetime from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .. import _serialization if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -22,13 +22,13 @@ class AddressDetails(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.AddressProperties + :vartype forward_address: ~azure.mgmt.edgeorder.models.AddressProperties :ivar return_address: Return shipping address. - :vartype return_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :vartype return_address: ~azure.mgmt.edgeorder.models.AddressProperties """ _validation = { @@ -45,7 +45,7 @@ def __init__(self, *, forward_address: "_models.AddressProperties", **kwargs: An """ :keyword forward_address: Customer address and contact details. It should be address resource. Required. - :paramtype forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :paramtype forward_address: ~azure.mgmt.edgeorder.models.AddressProperties """ super().__init__(**kwargs) self.forward_address = forward_address @@ -57,16 +57,15 @@ class AddressProperties(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.ShippingAddress + :vartype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress :ivar contact_details: Contact details for the address. Required. - :vartype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + :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.v2021_12_01.models.AddressValidationStatus + :vartype address_validation_status: str or ~azure.mgmt.edgeorder.models.AddressValidationStatus """ _validation = { @@ -89,9 +88,9 @@ def __init__( ) -> None: """ :keyword shipping_address: Shipping details for the address. - :paramtype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :paramtype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress :keyword contact_details: Contact details for the address. Required. - :paramtype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + :paramtype contact_details: ~azure.mgmt.edgeorder.models.ContactDetails """ super().__init__(**kwargs) self.shipping_address = shipping_address @@ -105,7 +104,7 @@ class Resource(_serialization.Model): 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}. + /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 @@ -140,10 +139,10 @@ class TrackedResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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}. + /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 @@ -188,10 +187,10 @@ class AddressResource(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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}. + /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 @@ -203,15 +202,14 @@ class AddressResource(TrackedResource): :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2021_12_01.models.SystemData + :vartype system_data: ~azure.mgmt.edgeorder.models.SystemData :ivar shipping_address: Shipping details for the address. - :vartype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :vartype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress :ivar contact_details: Contact details for the address. Required. - :vartype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + :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.v2021_12_01.models.AddressValidationStatus + :vartype address_validation_status: str or ~azure.mgmt.edgeorder.models.AddressValidationStatus """ _validation = { @@ -251,9 +249,9 @@ def __init__( :keyword location: The geo-location where the resource lives. Required. :paramtype location: str :keyword shipping_address: Shipping details for the address. - :paramtype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :paramtype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress :keyword contact_details: Contact details for the address. Required. - :paramtype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + :paramtype contact_details: ~azure.mgmt.edgeorder.models.ContactDetails """ super().__init__(tags=tags, location=location, **kwargs) self.system_data = None @@ -268,7 +266,7 @@ class AddressResourceList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of address resources. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :vartype value: list[~azure.mgmt.edgeorder.models.AddressResource] :ivar next_link: Link for the next set of job resources. :vartype next_link: str """ @@ -299,9 +297,9 @@ class AddressUpdateParameter(_serialization.Model): viewing and grouping this resource (across resource groups). :vartype tags: dict[str, str] :ivar shipping_address: Shipping details for the address. - :vartype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :vartype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress :ivar contact_details: Contact details for the address. - :vartype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + :vartype contact_details: ~azure.mgmt.edgeorder.models.ContactDetails """ _attribute_map = { @@ -323,9 +321,9 @@ def __init__( in viewing and grouping this resource (across resource groups). :paramtype tags: dict[str, str] :keyword shipping_address: Shipping details for the address. - :paramtype shipping_address: ~azure.mgmt.edgeorder.v2021_12_01.models.ShippingAddress + :paramtype shipping_address: ~azure.mgmt.edgeorder.models.ShippingAddress :keyword contact_details: Contact details for the address. - :paramtype contact_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ContactDetails + :paramtype contact_details: ~azure.mgmt.edgeorder.models.ContactDetails """ super().__init__(**kwargs) self.tags = tags @@ -340,10 +338,10 @@ class AvailabilityInformation(_serialization.Model): :ivar availability_stage: Current availability stage of the product. Availability stage. Known values are: "Available", "ComingSoon", "Preview", "Deprecated", "Signup", and "Unavailable". - :vartype availability_stage: str or ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityStage + :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.v2021_12_01.models.DisabledReason + :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 """ @@ -376,16 +374,15 @@ class BasicInformation(_serialization.Model): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation """ _validation = { @@ -425,10 +422,10 @@ class BillingMeterDetails(_serialization.Model): :ivar name: Represents Billing type name. :vartype name: str :ivar meter_details: Represents MeterDetails. - :vartype meter_details: ~azure.mgmt.edgeorder.v2021_12_01.models.MeterDetails + :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.v2021_12_01.models.MeteringType + :vartype metering_type: str or ~azure.mgmt.edgeorder.models.MeteringType :ivar frequency: Frequency of recurrence. :vartype frequency: str """ @@ -459,7 +456,7 @@ def __init__(self, **kwargs: Any) -> None: class CancellationReason(_serialization.Model): """Reason for cancellation. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar reason: Reason for cancellation. Required. :vartype reason: str @@ -490,19 +487,17 @@ class CommonProperties(BasicInformation): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] """ _validation = { @@ -539,23 +534,21 @@ class Configuration(_serialization.Model): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2021_12_01.models.Specification] + :vartype specifications: list[~azure.mgmt.edgeorder.models.Specification] :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2021_12_01.models.Dimensions + :vartype dimensions: ~azure.mgmt.edgeorder.models.Dimensions """ _validation = { @@ -599,12 +592,12 @@ def __init__(self, **kwargs: Any) -> None: class ConfigurationFilters(_serialization.Model): """Configuration filters. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.HierarchyInformation + :vartype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation :ivar filterable_property: Filters specific to product. - :vartype filterable_property: list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] + :vartype filterable_property: list[~azure.mgmt.edgeorder.models.FilterableProperty] """ _validation = { @@ -625,10 +618,9 @@ def __init__( ) -> None: """ :keyword hierarchy_information: Product hierarchy information. Required. - :paramtype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :paramtype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation :keyword filterable_property: Filters specific to product. - :paramtype filterable_property: - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty] + :paramtype filterable_property: list[~azure.mgmt.edgeorder.models.FilterableProperty] """ super().__init__(**kwargs) self.hierarchy_information = hierarchy_information @@ -643,23 +635,21 @@ class ConfigurationProperties(CommonProperties): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2021_12_01.models.Specification] + :vartype specifications: list[~azure.mgmt.edgeorder.models.Specification] :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2021_12_01.models.Dimensions + :vartype dimensions: ~azure.mgmt.edgeorder.models.Dimensions """ _validation = { @@ -699,7 +689,7 @@ class Configurations(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of configurations. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :vartype value: list[~azure.mgmt.edgeorder.models.Configuration] :ivar next_link: Link for the next set of configurations. :vartype next_link: str """ @@ -726,16 +716,15 @@ def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: class ConfigurationsRequest(_serialization.Model): """Configuration request object. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.ConfigurationFilters] + :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.v2021_12_01.models.CustomerSubscriptionDetails + ~azure.mgmt.edgeorder.models.CustomerSubscriptionDetails """ _validation = { @@ -757,12 +746,11 @@ def __init__( """ :keyword configuration_filters: Holds details about product hierarchy information and filterable property. Required. - :paramtype configuration_filters: - list[~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationFilters] + :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.v2021_12_01.models.CustomerSubscriptionDetails + ~azure.mgmt.edgeorder.models.CustomerSubscriptionDetails """ super().__init__(**kwargs) self.configuration_filters = configuration_filters @@ -772,7 +760,7 @@ def __init__( class ContactDetails(_serialization.Model): """Contact Details. - All required parameters must be populated in order to send to Azure. + 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 @@ -836,8 +824,7 @@ class CostInformation(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar billing_meter_details: Details on the various billing aspects for the product system. - :vartype billing_meter_details: - list[~azure.mgmt.edgeorder.v2021_12_01.models.BillingMeterDetails] + :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 """ @@ -863,11 +850,11 @@ class CustomerSubscriptionDetails(_serialization.Model): """Holds Customer subscription details. Clients can display available products to unregistered customers by explicitly passing subscription details. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.CustomerSubscriptionRegisteredFeatures] + 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. @@ -895,7 +882,7 @@ def __init__( """ :keyword registered_features: List of registered feature flags for subscription. :paramtype registered_features: - list[~azure.mgmt.edgeorder.v2021_12_01.models.CustomerSubscriptionRegisteredFeatures] + 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. @@ -939,7 +926,7 @@ class Description(_serialization.Model): 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.v2021_12_01.models.DescriptionType + :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. @@ -949,7 +936,7 @@ class Description(_serialization.Model): :ivar attributes: Attributes for the product system. :vartype attributes: list[str] :ivar links: Links for the product system. - :vartype links: list[~azure.mgmt.edgeorder.v2021_12_01.models.Link] + :vartype links: list[~azure.mgmt.edgeorder.models.Link] """ _validation = { @@ -1026,14 +1013,14 @@ class Dimensions(_serialization.Model): :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.v2021_12_01.models.LengthHeightUnit + 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.v2021_12_01.models.WeightMeasurementUnit + :vartype weight_unit: str or ~azure.mgmt.edgeorder.models.WeightMeasurementUnit """ _validation = { @@ -1102,8 +1089,7 @@ class EncryptionPreferences(_serialization.Model): :ivar double_encryption_status: Double encryption status as entered by the customer. It is compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known values are: "Disabled" and "Enabled". - :vartype double_encryption_status: str or - ~azure.mgmt.edgeorder.v2021_12_01.models.DoubleEncryptionStatus + :vartype double_encryption_status: str or ~azure.mgmt.edgeorder.models.DoubleEncryptionStatus """ _attribute_map = { @@ -1117,8 +1103,7 @@ def __init__( :keyword double_encryption_status: Double encryption status as entered by the customer. It is compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known values are: "Disabled" and "Enabled". - :paramtype double_encryption_status: str or - ~azure.mgmt.edgeorder.v2021_12_01.models.DoubleEncryptionStatus + :paramtype double_encryption_status: str or ~azure.mgmt.edgeorder.models.DoubleEncryptionStatus """ super().__init__(**kwargs) self.double_encryption_status = double_encryption_status @@ -1164,9 +1149,9 @@ class ErrorDetail(_serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail] + :vartype details: list[~azure.mgmt.edgeorder.models.ErrorDetail] :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.edgeorder.v2021_12_01.models.ErrorAdditionalInfo] + :vartype additional_info: list[~azure.mgmt.edgeorder.models.ErrorAdditionalInfo] """ _validation = { @@ -1200,7 +1185,7 @@ class ErrorResponse(_serialization.Model): operations. (This also follows the OData error response format.). :ivar error: The error object. - :vartype error: ~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail + :vartype error: ~azure.mgmt.edgeorder.models.ErrorDetail """ _attribute_map = { @@ -1210,7 +1195,7 @@ class ErrorResponse(_serialization.Model): def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. - :paramtype error: ~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail + :paramtype error: ~azure.mgmt.edgeorder.models.ErrorDetail """ super().__init__(**kwargs) self.error = error @@ -1219,11 +1204,11 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A class FilterableProperty(_serialization.Model): """Different types of filters supported and its values. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.SupportedFilterTypes + :vartype type: str or ~azure.mgmt.edgeorder.models.SupportedFilterTypes :ivar supported_values: Values to be filtered. Required. :vartype supported_values: list[str] """ @@ -1244,7 +1229,7 @@ def __init__( """ :keyword type: Type of product filter. Required. Known values are: "ShipToCountries" and "DoubleEncryptionStatus". - :paramtype type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.SupportedFilterTypes + :paramtype type: str or ~azure.mgmt.edgeorder.models.SupportedFilterTypes :keyword supported_values: Values to be filtered. Required. :paramtype supported_values: list[str] """ @@ -1348,7 +1333,7 @@ class ImageInformation(_serialization.Model): :ivar image_type: Type of the image. Known values are: "MainImage", "BulletImage", and "GenericImage". - :vartype image_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.ImageType + :vartype image_type: str or ~azure.mgmt.edgeorder.models.ImageType :ivar image_url: Url of the image. :vartype image_url: str """ @@ -1377,7 +1362,7 @@ class Link(_serialization.Model): :ivar link_type: Type of link. Known values are: "Generic", "TermsAndConditions", "Specification", "Documentation", "KnowMore", and "SignUp". - :vartype link_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.LinkType + :vartype link_type: str or ~azure.mgmt.edgeorder.models.LinkType :ivar link_url: Url of the link. :vartype link_url: str """ @@ -1427,14 +1412,14 @@ class MeterDetails(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.BillingType + :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.v2021_12_01.models.ChargingType + :vartype charging_type: str or ~azure.mgmt.edgeorder.models.ChargingType """ _validation = { @@ -1462,10 +1447,10 @@ def __init__(self, **kwargs: Any) -> None: class NotificationPreference(_serialization.Model): """Notification preference for a job stage. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.NotificationStageName + :vartype stage_name: str or ~azure.mgmt.edgeorder.models.NotificationStageName :ivar send_notification: Notification is required or not. Required. :vartype send_notification: bool """ @@ -1485,7 +1470,7 @@ def __init__( ) -> None: """ :keyword stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". - :paramtype stage_name: str or ~azure.mgmt.edgeorder.v2021_12_01.models.NotificationStageName + :paramtype stage_name: str or ~azure.mgmt.edgeorder.models.NotificationStageName :keyword send_notification: Notification is required or not. Required. :paramtype send_notification: bool """ @@ -1506,14 +1491,14 @@ class Operation(_serialization.Model): 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.v2021_12_01.models.OperationDisplay + :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.v2021_12_01.models.Origin + :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.v2021_12_01.models.ActionType + :vartype action_type: str or ~azure.mgmt.edgeorder.models.ActionType """ _validation = { @@ -1534,7 +1519,7 @@ class Operation(_serialization.Model): def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.edgeorder.v2021_12_01.models.OperationDisplay + :paramtype display: ~azure.mgmt.edgeorder.models.OperationDisplay """ super().__init__(**kwargs) self.name = None @@ -1593,7 +1578,7 @@ class OperationListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.Operation] + :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 """ @@ -1620,49 +1605,44 @@ class OrderItemDetails(_serialization.Model): # pylint: disable=too-many-instan Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.ProductDetails + :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.v2021_12_01.models.OrderItemType + :vartype order_item_type: str or ~azure.mgmt.edgeorder.models.OrderItemType :ivar current_stage: Current Order item Status. - :vartype current_stage: ~azure.mgmt.edgeorder.v2021_12_01.models.StageDetails + :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.v2021_12_01.models.StageDetails] + :vartype order_item_stage_history: list[~azure.mgmt.edgeorder.models.StageDetails] :ivar preferences: Customer notification Preferences. - :vartype preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences + :vartype preferences: ~azure.mgmt.edgeorder.models.Preferences :ivar forward_shipping_details: Forward Package Shipping details. - :vartype forward_shipping_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ForwardShippingDetails + :vartype forward_shipping_details: ~azure.mgmt.edgeorder.models.ForwardShippingDetails :ivar reverse_shipping_details: Reverse Package Shipping details. - :vartype reverse_shipping_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ReverseShippingDetails + :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.v2021_12_01.models.OrderItemCancellationEnum + :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.v2021_12_01.models.ActionStatusEnum + :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.v2021_12_01.models.OrderItemReturnEnum + :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.v2021_12_01.models.ResourceProviderDetails + :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.v2021_12_01.models.ResourceProviderDetails] + :vartype management_rp_details_list: list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.edgeorder.v2021_12_01.models.ErrorDetail + :vartype error: ~azure.mgmt.edgeorder.models.ErrorDetail """ _validation = { @@ -1712,11 +1692,11 @@ def __init__( ) -> None: """ :keyword product_details: Unique identifier for configuration. Required. - :paramtype product_details: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductDetails + :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.v2021_12_01.models.OrderItemType + :paramtype order_item_type: str or ~azure.mgmt.edgeorder.models.OrderItemType :keyword preferences: Customer notification Preferences. - :paramtype preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences + :paramtype preferences: ~azure.mgmt.edgeorder.models.Preferences :keyword notification_email_list: Additional notification email list. :paramtype notification_email_list: list[str] """ @@ -1744,10 +1724,10 @@ class OrderItemResource(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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}. + /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 @@ -1759,11 +1739,11 @@ class OrderItemResource(TrackedResource): :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2021_12_01.models.SystemData + :vartype system_data: ~azure.mgmt.edgeorder.models.SystemData :ivar order_item_details: Represents order item details. Required. - :vartype order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemDetails + :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.v2021_12_01.models.AddressDetails + :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. @@ -1811,9 +1791,9 @@ def __init__( :keyword location: The geo-location where the resource lives. Required. :paramtype location: str :keyword order_item_details: Represents order item details. Required. - :paramtype order_item_details: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemDetails + :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.v2021_12_01.models.AddressDetails + :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 """ @@ -1831,7 +1811,7 @@ class OrderItemResourceList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of order item resources. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :vartype value: list[~azure.mgmt.edgeorder.models.OrderItemResource] :ivar next_link: Link for the next set of order item resources. :vartype next_link: str """ @@ -1862,9 +1842,9 @@ class OrderItemUpdateParameter(_serialization.Model): viewing and grouping this resource (across resource groups). :vartype tags: dict[str, str] :ivar forward_address: Updates forward shipping address and contact details. - :vartype forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :vartype forward_address: ~azure.mgmt.edgeorder.models.AddressProperties :ivar preferences: Customer preference. - :vartype preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences + :vartype preferences: ~azure.mgmt.edgeorder.models.Preferences :ivar notification_email_list: Additional notification email list. :vartype notification_email_list: list[str] """ @@ -1890,9 +1870,9 @@ def __init__( in viewing and grouping this resource (across resource groups). :paramtype tags: dict[str, str] :keyword forward_address: Updates forward shipping address and contact details. - :paramtype forward_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :paramtype forward_address: ~azure.mgmt.edgeorder.models.AddressProperties :keyword preferences: Customer preference. - :paramtype preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.Preferences + :paramtype preferences: ~azure.mgmt.edgeorder.models.Preferences :keyword notification_email_list: Additional notification email list. :paramtype notification_email_list: list[str] """ @@ -1910,7 +1890,7 @@ class ProxyResource(Resource): 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}. + /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 @@ -1919,22 +1899,6 @@ class ProxyResource(Resource): :vartype type: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - class OrderResource(ProxyResource): """Specifies the properties or parameters for an order. Order is a grouping of one or more order @@ -1943,7 +1907,7 @@ class OrderResource(ProxyResource): 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}. + /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 @@ -1951,13 +1915,13 @@ class OrderResource(ProxyResource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2021_12_01.models.SystemData + :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.v2021_12_01.models.StageDetails + :vartype current_stage: ~azure.mgmt.edgeorder.models.StageDetails :ivar order_stage_history: Order status history. - :vartype order_stage_history: list[~azure.mgmt.edgeorder.v2021_12_01.models.StageDetails] + :vartype order_stage_history: list[~azure.mgmt.edgeorder.models.StageDetails] """ _validation = { @@ -1995,7 +1959,7 @@ class OrderResourceList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of order resources. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource] + :vartype value: list[~azure.mgmt.edgeorder.models.OrderResource] :ivar next_link: Link for the next set of order resources. :vartype next_link: str """ @@ -2024,14 +1988,14 @@ class Pav2MeterDetails(MeterDetails): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.BillingType + :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.v2021_12_01.models.ChargingType + :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 """ @@ -2061,15 +2025,14 @@ class Preferences(_serialization.Model): """Preferences related to the order. :ivar notification_preferences: Notification preferences. - :vartype notification_preferences: - list[~azure.mgmt.edgeorder.v2021_12_01.models.NotificationPreference] + :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.v2021_12_01.models.TransportPreferences + :vartype transport_preferences: ~azure.mgmt.edgeorder.models.TransportPreferences :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: ~azure.mgmt.edgeorder.v2021_12_01.models.EncryptionPreferences + :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.v2021_12_01.models.ManagementResourcePreferences + ~azure.mgmt.edgeorder.models.ManagementResourcePreferences """ _attribute_map = { @@ -2093,16 +2056,14 @@ def __init__( ) -> None: """ :keyword notification_preferences: Notification preferences. - :paramtype notification_preferences: - list[~azure.mgmt.edgeorder.v2021_12_01.models.NotificationPreference] + :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.v2021_12_01.models.TransportPreferences + :paramtype transport_preferences: ~azure.mgmt.edgeorder.models.TransportPreferences :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: - ~azure.mgmt.edgeorder.v2021_12_01.models.EncryptionPreferences + :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.v2021_12_01.models.ManagementResourcePreferences + ~azure.mgmt.edgeorder.models.ManagementResourcePreferences """ super().__init__(**kwargs) self.notification_preferences = notification_preferences @@ -2119,21 +2080,19 @@ class Product(_serialization.Model): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :vartype configurations: list[~azure.mgmt.edgeorder.models.Configuration] """ _validation = { @@ -2176,21 +2135,21 @@ class ProductDetails(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.DisplayInfo + :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.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.DoubleEncryptionStatus + ~azure.mgmt.edgeorder.models.DoubleEncryptionStatus :ivar device_details: list of device details. - :vartype device_details: list[~azure.mgmt.edgeorder.v2021_12_01.models.DeviceDetails] + :vartype device_details: list[~azure.mgmt.edgeorder.models.DeviceDetails] """ _validation = { @@ -2217,10 +2176,10 @@ def __init__( ) -> None: """ :keyword display_info: Display details of the product. - :paramtype display_info: ~azure.mgmt.edgeorder.v2021_12_01.models.DisplayInfo + :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.v2021_12_01.models.HierarchyInformation + :paramtype hierarchy_information: ~azure.mgmt.edgeorder.models.HierarchyInformation """ super().__init__(**kwargs) self.display_info = display_info @@ -2236,7 +2195,7 @@ class ProductFamilies(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of product families. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :vartype value: list[~azure.mgmt.edgeorder.models.ProductFamily] :ivar next_link: Link for the next set of product families. :vartype next_link: str """ @@ -2266,7 +2225,7 @@ class ProductFamiliesMetadata(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of product family metadata details. - :vartype value: list[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] + :vartype value: list[~azure.mgmt.edgeorder.models.ProductFamiliesMetadataDetails] :ivar next_link: Link for the next set of product families. :vartype next_link: str """ @@ -2296,24 +2255,21 @@ class ProductFamiliesMetadataDetails(_serialization.Model): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :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.v2021_12_01.models.ProductLine] + :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.v2021_12_01.models.ResourceProviderDetails] + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] """ _validation = { @@ -2345,7 +2301,7 @@ def __init__( """ :keyword resource_provider_details: Contains details related to resource provider. :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] + list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] """ super().__init__(**kwargs) self.display_name = None @@ -2362,15 +2318,15 @@ def __init__( class ProductFamiliesRequest(_serialization.Model): """The filters for showing the product families. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.FilterableProperty]] + 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.v2021_12_01.models.CustomerSubscriptionDetails + ~azure.mgmt.edgeorder.models.CustomerSubscriptionDetails """ _validation = { @@ -2393,11 +2349,11 @@ def __init__( :keyword filterable_properties: Dictionary of filterable properties on product family. Required. :paramtype filterable_properties: dict[str, - list[~azure.mgmt.edgeorder.v2021_12_01.models.FilterableProperty]] + 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.v2021_12_01.models.CustomerSubscriptionDetails + ~azure.mgmt.edgeorder.models.CustomerSubscriptionDetails """ super().__init__(**kwargs) self.filterable_properties = filterable_properties @@ -2412,24 +2368,21 @@ class ProductFamily(_serialization.Model): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :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.v2021_12_01.models.ProductLine] + :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.v2021_12_01.models.ResourceProviderDetails] + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] """ _validation = { @@ -2461,7 +2414,7 @@ def __init__( """ :keyword resource_provider_details: Contains details related to resource provider. :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] + list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] """ super().__init__(**kwargs) self.display_name = None @@ -2483,24 +2436,21 @@ class ProductFamilyProperties(CommonProperties): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :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.v2021_12_01.models.ProductLine] + :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.v2021_12_01.models.ResourceProviderDetails] + :vartype resource_provider_details: list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] """ _validation = { @@ -2532,7 +2482,7 @@ def __init__( """ :keyword resource_provider_details: Contains details related to resource provider. :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.v2021_12_01.models.ResourceProviderDetails] + list[~azure.mgmt.edgeorder.models.ResourceProviderDetails] """ super().__init__(**kwargs) self.product_lines = None @@ -2547,21 +2497,19 @@ class ProductLine(_serialization.Model): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2021_12_01.models.Product] + :vartype products: list[~azure.mgmt.edgeorder.models.Product] """ _validation = { @@ -2607,21 +2555,19 @@ class ProductLineProperties(CommonProperties): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2021_12_01.models.Product] + :vartype products: list[~azure.mgmt.edgeorder.models.Product] """ _validation = { @@ -2660,21 +2606,19 @@ class ProductProperties(CommonProperties): :ivar display_name: Display Name for the product system. :vartype display_name: str :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2021_12_01.models.Description + :vartype description: ~azure.mgmt.edgeorder.models.Description :ivar image_information: Image information for the product system. - :vartype image_information: list[~azure.mgmt.edgeorder.v2021_12_01.models.ImageInformation] + :vartype image_information: list[~azure.mgmt.edgeorder.models.ImageInformation] :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2021_12_01.models.CostInformation + :vartype cost_information: ~azure.mgmt.edgeorder.models.CostInformation :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2021_12_01.models.AvailabilityInformation + :vartype availability_information: ~azure.mgmt.edgeorder.models.AvailabilityInformation :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: ~azure.mgmt.edgeorder.v2021_12_01.models.HierarchyInformation + :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.v2021_12_01.models.FilterableProperty] + :vartype filterable_properties: list[~azure.mgmt.edgeorder.models.FilterableProperty] :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :vartype configurations: list[~azure.mgmt.edgeorder.models.Configuration] """ _validation = { @@ -2710,14 +2654,14 @@ class PurchaseMeterDetails(MeterDetails): Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.BillingType + :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.v2021_12_01.models.ChargingType + :vartype charging_type: str or ~azure.mgmt.edgeorder.models.ChargingType :ivar product_id: Product Id. :vartype product_id: str :ivar sku_id: Sku Id. @@ -2814,10 +2758,10 @@ def __init__(self, **kwargs: Any) -> None: class ReturnOrderItemDetails(_serialization.Model): """Return order item request body. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar return_address: customer return address. - :vartype return_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :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). @@ -2848,7 +2792,7 @@ def __init__( ) -> None: """ :keyword return_address: customer return address. - :paramtype return_address: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressProperties + :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). @@ -2910,7 +2854,7 @@ def __init__(self, **kwargs: Any) -> None: class ShippingAddress(_serialization.Model): """Shipping address where customer wishes to receive the device. - All required parameters must be populated in order to send to Azure. + All required parameters must be populated in order to send to server. :ivar street_address1: Street Address line 1. Required. :vartype street_address1: str @@ -2931,7 +2875,7 @@ class ShippingAddress(_serialization.Model): :ivar company_name: Name of the company. :vartype company_name: str :ivar address_type: Type of address. Known values are: "None", "Residential", and "Commercial". - :vartype address_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.AddressType + :vartype address_type: str or ~azure.mgmt.edgeorder.models.AddressType """ _validation = { @@ -2988,7 +2932,7 @@ def __init__( :paramtype company_name: str :keyword address_type: Type of address. Known values are: "None", "Residential", and "Commercial". - :paramtype address_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.AddressType + :paramtype address_type: str or ~azure.mgmt.edgeorder.models.AddressType """ super().__init__(**kwargs) self.street_address1 = street_address1 @@ -3077,11 +3021,11 @@ class StageDetails(_serialization.Model): :ivar stage_status: Stage status. Known values are: "None", "InProgress", "Succeeded", "Failed", "Cancelled", and "Cancelling". - :vartype stage_status: str or ~azure.mgmt.edgeorder.v2021_12_01.models.StageStatus + :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.v2021_12_01.models.StageName + :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. @@ -3118,14 +3062,14 @@ class SystemData(_serialization.Model): :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType + :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.v2021_12_01.models.CreatedByType + :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 """ @@ -3155,14 +3099,14 @@ def __init__( :paramtype created_by: str :keyword created_by_type: The type of identity that created the resource. Known values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.edgeorder.v2021_12_01.models.CreatedByType + :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.v2021_12_01.models.CreatedByType + :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 """ @@ -3178,12 +3122,11 @@ def __init__( class TransportPreferences(_serialization.Model): """Preferences related to the shipment logistics of the sku. - All required parameters must be populated in order to send to Azure. + 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.v2021_12_01.models.TransportShipmentTypes + :vartype preferred_shipment_type: str or ~azure.mgmt.edgeorder.models.TransportShipmentTypes """ _validation = { @@ -3198,8 +3141,7 @@ def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShip """ :keyword preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. Required. Known values are: "CustomerManaged" and "MicrosoftManaged". - :paramtype preferred_shipment_type: str or - ~azure.mgmt.edgeorder.v2021_12_01.models.TransportShipmentTypes + :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/v2020_12_01_preview/models/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_patch.py similarity index 100% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_patch.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/models/_patch.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/__init__.py similarity index 100% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/__init__.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/__init__.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_edge_order_management_client_operations.py similarity index 72% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_edge_order_management_client_operations.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_edge_order_management_client_operations.py index 0bbd3ea38795..d58ec28e1841 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_edge_order_management_client_operations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_edge_order_management_client_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -16,26 +17,27 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer -from .._vendor import EdgeOrderManagementClientMixinABC, _convert_request, _format_url_section +from .._serialization import Serializer +from .._vendor import EdgeOrderManagementClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +49,7 @@ def build_list_operations_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,13 +64,13 @@ 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( +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 ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,7 +79,7 @@ def build_list_addresses_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,7 +100,7 @@ def build_list_product_families_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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)) accept = _headers.pop("Accept", "application/json") @@ -110,7 +112,7 @@ def build_list_product_families_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -133,7 +135,7 @@ def build_list_configurations_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +147,7 @@ def build_list_configurations_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -160,13 +162,13 @@ def build_list_configurations_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_product_families_metadata_request( +def build_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: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +179,7 @@ def build_list_product_families_metadata_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,13 +192,13 @@ def build_list_product_families_metadata_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_order_at_subscription_level_request( +def build_list_order_at_subscription_level_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: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +207,7 @@ def build_list_order_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -218,7 +220,7 @@ def build_list_order_at_subscription_level_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_order_items_at_subscription_level_request( +def build_list_order_items_at_subscription_level_request( # pylint: disable=name-too-long subscription_id: str, *, filter: Optional[str] = None, @@ -229,7 +231,7 @@ def build_list_order_items_at_subscription_level_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -238,7 +240,7 @@ def build_list_order_items_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -255,7 +257,7 @@ def build_list_order_items_at_subscription_level_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_addresses_at_resource_group_level_request( +def build_list_addresses_at_resource_group_level_request( # pylint: disable=name-too-long resource_group_name: str, subscription_id: str, *, @@ -266,7 +268,7 @@ def build_list_addresses_at_resource_group_level_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +283,7 @@ def build_list_addresses_at_resource_group_level_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -302,7 +304,7 @@ def build_get_address_by_name_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +322,7 @@ def build_get_address_by_name_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -337,7 +339,7 @@ def build_create_address_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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)) accept = _headers.pop("Accept", "application/json") @@ -356,7 +358,7 @@ def build_create_address_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -375,7 +377,7 @@ def build_delete_address_by_name_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -393,7 +395,7 @@ def build_delete_address_by_name_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -410,7 +412,7 @@ def build_update_address_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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)) accept = _headers.pop("Accept", "application/json") @@ -429,7 +431,7 @@ def build_update_address_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -444,13 +446,13 @@ def build_update_address_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_order_at_resource_group_level_request( +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 ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -465,7 +467,7 @@ def build_list_order_at_resource_group_level_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -484,7 +486,7 @@ def build_get_order_by_name_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -501,7 +503,7 @@ def build_get_order_by_name_request( "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -512,7 +514,7 @@ def build_get_order_by_name_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_order_items_at_resource_group_level_request( +def build_list_order_items_at_resource_group_level_request( # pylint: disable=name-too-long resource_group_name: str, subscription_id: str, *, @@ -524,7 +526,7 @@ def build_list_order_items_at_resource_group_level_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -539,7 +541,7 @@ def build_list_order_items_at_resource_group_level_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -562,7 +564,7 @@ def build_get_order_item_by_name_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -578,7 +580,7 @@ def build_get_order_item_by_name_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -597,7 +599,7 @@ def build_create_order_item_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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)) accept = _headers.pop("Accept", "application/json") @@ -614,7 +616,7 @@ def build_create_order_item_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -633,7 +635,7 @@ def build_delete_order_item_by_name_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -649,7 +651,7 @@ def build_delete_order_item_by_name_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -671,7 +673,7 @@ def build_update_order_item_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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)) accept = _headers.pop("Accept", "application/json") @@ -688,7 +690,7 @@ def build_update_order_item_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -709,7 +711,7 @@ def build_cancel_order_item_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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)) accept = _headers.pop("Accept", "application/json") @@ -726,7 +728,7 @@ def build_cancel_order_item_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -745,7 +747,7 @@ def build_return_order_item_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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)) accept = _headers.pop("Accept", "application/json") @@ -762,7 +764,7 @@ def build_return_order_item_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -775,25 +777,25 @@ def build_return_order_item_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -class EdgeOrderManagementClientOperationsMixin( +class EdgeOrderManagementClientOperationsMixin( # pylint: disable=too-many-public-methods EdgeOrderManagementClientMixinABC -): # pylint: disable=too-many-public-methods +): + @distributed_trace def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: """This method gets all the operations that are exposed for customer. - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,14 +806,12 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - request = build_list_operations_request( + _request = build_list_operations_request( api_version=api_version, - template_url=self.list_operations.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -823,13 +823,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) @@ -839,10 +838,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -855,8 +855,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_operations.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} - @distributed_trace def list_addresses_at_subscription_level( self, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any @@ -869,18 +867,17 @@ def list_addresses_at_subscription_level( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -891,17 +888,15 @@ def list_addresses_at_subscription_level( def prepare_request(next_link=None): if not next_link: - request = build_list_addresses_at_subscription_level_request( + _request = build_list_addresses_at_subscription_level_request( subscription_id=self._config.subscription_id, filter=filter, skip_token=skip_token, api_version=api_version, - template_url=self.list_addresses_at_subscription_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -913,13 +908,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AddressResourceList", pipeline_response) @@ -929,10 +923,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -945,10 +940,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_addresses_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses" - } - @overload def list_product_families( self, @@ -962,7 +953,7 @@ def list_product_families( """This method provides the list of product families for the given subscription. :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest + :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 @@ -972,16 +963,15 @@ def list_product_families( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ @overload def list_product_families( self, - product_families_request: IO, + product_families_request: IO[bytes], expand: Optional[str] = None, skip_token: Optional[str] = None, *, @@ -991,7 +981,7 @@ def list_product_families( """This method provides the list of product families for the given subscription. :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: IO + :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 @@ -1001,16 +991,15 @@ def list_product_families( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamily] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def list_product_families( self, - product_families_request: Union[_models.ProductFamiliesRequest, IO], + product_families_request: Union[_models.ProductFamiliesRequest, IO[bytes]], expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any @@ -1018,31 +1007,27 @@ def list_product_families( """This method provides the list of product families for the given subscription. :param product_families_request: Filters for showing the product families. Is either a - ProductFamiliesRequest type or a IO type. Required. - :type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest - or IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily] + :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: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1052,7 +1037,7 @@ def list_product_families( content_type = content_type or "application/json" _json = None _content = None - if isinstance(product_families_request, (IO, bytes)): + if isinstance(product_families_request, (IOBase, bytes)): _content = product_families_request else: _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") @@ -1060,7 +1045,7 @@ def list_product_families( def prepare_request(next_link=None): if not next_link: - request = build_list_product_families_request( + _request = build_list_product_families_request( subscription_id=self._config.subscription_id, expand=expand, skip_token=skip_token, @@ -1068,12 +1053,10 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, content=_content, - template_url=self.list_product_families.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1085,13 +1068,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ProductFamilies", pipeline_response) @@ -1101,10 +1083,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1117,10 +1100,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_product_families.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" - } - @overload def list_configurations( self, @@ -1134,23 +1113,22 @@ def list_configurations( product under subscription. :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest + :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 :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ @overload def list_configurations( self, - configurations_request: IO, + configurations_request: IO[bytes], skip_token: Optional[str] = None, *, content_type: str = "application/json", @@ -1160,23 +1138,22 @@ def list_configurations( product under subscription. :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: IO + :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. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def list_configurations( self, - configurations_request: Union[_models.ConfigurationsRequest, IO], + configurations_request: Union[_models.ConfigurationsRequest, IO[bytes]], skip_token: Optional[str] = None, **kwargs: Any ) -> Iterable["_models.Configuration"]: @@ -1184,28 +1161,23 @@ def list_configurations( product under subscription. :param configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO type. Required. - :type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or - IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration] + :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: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1215,7 +1187,7 @@ def list_configurations( content_type = content_type or "application/json" _json = None _content = None - if isinstance(configurations_request, (IO, bytes)): + if isinstance(configurations_request, (IOBase, bytes)): _content = configurations_request else: _json = self._serialize.body(configurations_request, "ConfigurationsRequest") @@ -1223,19 +1195,17 @@ def list_configurations( def prepare_request(next_link=None): if not next_link: - request = build_list_configurations_request( + _request = build_list_configurations_request( subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.list_configurations.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1247,13 +1217,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("Configurations", pipeline_response) @@ -1263,10 +1232,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1279,10 +1249,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_configurations.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" - } - @distributed_trace def list_product_families_metadata( self, skip_token: Optional[str] = None, **kwargs: Any @@ -1292,20 +1258,19 @@ def list_product_families_metadata( :param skip_token: $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. Default value is None. :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails] + ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.models.ProductFamiliesMetadataDetails] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1316,16 +1281,14 @@ def list_product_families_metadata( def prepare_request(next_link=None): if not next_link: - request = build_list_product_families_metadata_request( + _request = build_list_product_families_metadata_request( subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, - template_url=self.list_product_families_metadata.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1337,13 +1300,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) @@ -1353,10 +1315,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1369,10 +1332,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_product_families_metadata.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" - } - @distributed_trace def list_order_at_subscription_level( self, skip_token: Optional[str] = None, **kwargs: Any @@ -1382,18 +1341,17 @@ def list_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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1404,16 +1362,14 @@ def list_order_at_subscription_level( def prepare_request(next_link=None): if not next_link: - request = build_list_order_at_subscription_level_request( + _request = build_list_order_at_subscription_level_request( subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, - template_url=self.list_order_at_subscription_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1425,13 +1381,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("OrderResourceList", pipeline_response) @@ -1441,10 +1396,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1457,10 +1413,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_order_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders" - } - @distributed_trace def list_order_items_at_subscription_level( self, @@ -1483,19 +1435,17 @@ def list_order_items_at_subscription_level( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1506,18 +1456,16 @@ 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_list_order_items_at_subscription_level_request( subscription_id=self._config.subscription_id, filter=filter, expand=expand, skip_token=skip_token, api_version=api_version, - template_url=self.list_order_items_at_subscription_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1529,13 +1477,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("OrderItemResourceList", pipeline_response) @@ -1545,10 +1492,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1561,10 +1509,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_order_items_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems" - } - @distributed_trace def list_addresses_at_resource_group_level( self, resource_group_name: str, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any @@ -1580,18 +1524,17 @@ def list_addresses_at_resource_group_level( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1602,18 +1545,16 @@ 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( + _request = build_list_addresses_at_resource_group_level_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, filter=filter, skip_token=skip_token, api_version=api_version, - template_url=self.list_addresses_at_resource_group_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -1625,13 +1566,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("AddressResourceList", pipeline_response) @@ -1641,10 +1581,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1657,10 +1598,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_addresses_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" - } - @distributed_trace def get_address_by_name( self, address_name: str, resource_group_name: str, **kwargs: Any @@ -1674,12 +1611,11 @@ def get_address_by_name( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource + :rtype: ~azure.mgmt.edgeorder.models.AddressResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1690,23 +1626,22 @@ def get_address_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - request = build_get_address_by_name_request( + _request = build_get_address_by_name_request( address_name=address_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_address_by_name.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1716,25 +1651,21 @@ def get_address_by_name( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AddressResource", pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get_address_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return deserialized # type: ignore def _create_address_initial( self, address_name: str, resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], + address_resource: Union[_models.AddressResource, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1745,19 +1676,19 @@ def _create_address_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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[Optional[_models.AddressResource]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(address_resource, (IO, bytes)): + if isinstance(address_resource, (IOBase, bytes)): _content = address_resource else: _json = self._serialize.body(address_resource, "AddressResource") - request = build_create_address_request( + _request = build_create_address_request( address_name=address_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -1765,36 +1696,34 @@ def _create_address_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_address_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response 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) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - _create_address_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return deserialized # type: ignore @overload def begin_create_address( @@ -1817,21 +1746,13 @@ def begin_create_address( Required. :type resource_group_name: str :param address_resource: Address details from request body. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1840,7 +1761,7 @@ def begin_create_address( self, address_name: str, resource_group_name: str, - address_resource: IO, + address_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -1856,21 +1777,13 @@ def begin_create_address( Required. :type resource_group_name: str :param address_resource: Address details from request body. Required. - :type address_resource: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1879,7 +1792,7 @@ def begin_create_address( self, address_name: str, resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], + address_resource: Union[_models.AddressResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AddressResource]: """Creates a new address with the specified parameters. Existing address can be updated with this @@ -1893,28 +1806,17 @@ def begin_create_address( Required. :type resource_group_name: str :param address_resource: Address details from request body. Is either a AddressResource type or - a IO type. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + 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.v2021_12_01.models.AddressResource] + :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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1932,12 +1834,13 @@ def begin_create_address( 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("AddressResource", pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -1947,22 +1850,20 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_address.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return LROPoller[_models.AddressResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements + def _delete_address_by_name_initial( self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> None: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1973,38 +1874,42 @@ def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - request = build_delete_address_by_name_request( + _request = build_delete_address_by_name_request( address_name=address_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_address_by_name_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _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 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) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - _delete_address_by_name_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return deserialized # type: ignore @distributed_trace def begin_delete_address_by_name( @@ -2019,14 +1924,6 @@ def begin_delete_address_by_name( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2034,13 +1931,13 @@ def begin_delete_address_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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_address_by_name_initial( # type: ignore + raw_result = self._delete_address_by_name_initial( address_name=address_name, resource_group_name=resource_group_name, api_version=api_version, @@ -2049,11 +1946,12 @@ def begin_delete_address_by_name( params=_params, **kwargs ) + 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, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2062,27 +1960,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_address_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return LROPoller[None](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], + address_update_parameter: Union[_models.AddressUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2093,19 +1987,19 @@ def _update_address_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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[Optional[_models.AddressResource]] = kwargs.pop("cls", 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, (IO, bytes)): + 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( + _request = build_update_address_request( address_name=address_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -2114,36 +2008,34 @@ def _update_address_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_address_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response 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) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - _update_address_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return deserialized # type: ignore @overload def begin_update_address( @@ -2166,24 +2058,16 @@ def begin_update_address( Required. :type resource_group_name: str :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2192,7 +2076,7 @@ def begin_update_address( self, address_name: str, resource_group_name: str, - address_update_parameter: IO, + address_update_parameter: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", @@ -2208,24 +2092,16 @@ def begin_update_address( Required. :type resource_group_name: str :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.AddressResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2234,7 +2110,7 @@ def begin_update_address( self, address_name: str, resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], + address_update_parameter: Union[_models.AddressUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> LROPoller[_models.AddressResource]: @@ -2248,32 +2124,21 @@ def begin_update_address( Required. :type resource_group_name: str :param address_update_parameter: Address update parameters from request body. Is either a - AddressUpdateParameter type or a IO type. Required. - :type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter - or IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either AddressResource or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource] + :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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2292,12 +2157,13 @@ def begin_update_address( 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("AddressResource", pipeline_response) + deserialized = self._deserialize("AddressResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2307,17 +2173,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.from_continuation_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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_address.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } + return LROPoller[_models.AddressResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace def list_order_at_resource_group_level( @@ -2331,18 +2195,17 @@ def list_order_at_resource_group_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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2353,17 +2216,15 @@ 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_list_order_at_resource_group_level_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, skip_token=skip_token, api_version=api_version, - template_url=self.list_order_at_resource_group_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2375,13 +2236,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("OrderResourceList", pipeline_response) @@ -2391,10 +2251,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2407,10 +2268,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_order_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" - } - @distributed_trace def get_order_by_name( self, order_name: str, resource_group_name: str, location: str, **kwargs: Any @@ -2424,12 +2281,11 @@ def get_order_by_name( :type resource_group_name: str :param location: The name of Azure region. Required. :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource + :rtype: ~azure.mgmt.edgeorder.models.OrderResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2440,24 +2296,23 @@ def get_order_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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( + _request = build_get_order_by_name_request( order_name=order_name, resource_group_name=resource_group_name, location=location, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_order_by_name.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2467,16 +2322,12 @@ def get_order_by_name( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OrderResource", pipeline_response) + deserialized = self._deserialize("OrderResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get_order_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" - } + return deserialized # type: ignore @distributed_trace def list_order_items_at_resource_group_level( @@ -2504,19 +2355,17 @@ def list_order_items_at_resource_group_level( :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2527,19 +2376,17 @@ 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( + _request = build_list_order_items_at_resource_group_level_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, filter=filter, expand=expand, skip_token=skip_token, api_version=api_version, - template_url=self.list_order_items_at_resource_group_level.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version @@ -2551,13 +2398,12 @@ def prepare_request(next_link=None): } ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( + _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request def extract_data(pipeline_response): deserialized = self._deserialize("OrderItemResourceList", pipeline_response) @@ -2567,10 +2413,11 @@ def extract_data(pipeline_response): return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): - request = prepare_request(next_link) + _request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2583,10 +2430,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_order_items_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" - } - @distributed_trace def get_order_item_by_name( self, order_item_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any @@ -2604,12 +2447,11 @@ def get_order_item_by_name( Shipping details provide forward and reverse shipping details respectively. Default value is None. :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource + :rtype: ~azure.mgmt.edgeorder.models.OrderItemResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2620,24 +2462,23 @@ def get_order_item_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - request = build_get_order_item_by_name_request( + _request = build_get_order_item_by_name_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, expand=expand, api_version=api_version, - template_url=self.get_order_item_by_name.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2647,25 +2488,21 @@ def get_order_item_by_name( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OrderItemResource", pipeline_response) + deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - get_order_item_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return deserialized # type: ignore def _create_order_item_initial( self, order_item_name: str, resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], + order_item_resource: Union[_models.OrderItemResource, IO[bytes]], **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2676,19 +2513,19 @@ def _create_order_item_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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[Optional[_models.OrderItemResource]] = kwargs.pop("cls", 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, (IO, bytes)): + if isinstance(order_item_resource, (IOBase, bytes)): _content = order_item_resource else: _json = self._serialize.body(order_item_resource, "OrderItemResource") - request = build_create_order_item_request( + _request = build_create_order_item_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -2696,36 +2533,34 @@ def _create_order_item_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_order_item_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response 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) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - _create_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return deserialized # type: ignore @overload def begin_create_order_item( @@ -2746,22 +2581,13 @@ def begin_create_order_item( Required. :type resource_group_name: str :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2770,7 +2596,7 @@ def begin_create_order_item( self, order_item_name: str, resource_group_name: str, - order_item_resource: IO, + order_item_resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -2784,22 +2610,13 @@ def begin_create_order_item( Required. :type resource_group_name: str :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2808,7 +2625,7 @@ def begin_create_order_item( self, order_item_name: str, resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], + order_item_resource: Union[_models.OrderItemResource, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.OrderItemResource]: """Creates an order item. Existing order item cannot be updated with this api and should instead @@ -2820,29 +2637,17 @@ def begin_create_order_item( Required. :type resource_group_name: str :param order_item_resource: Order item details from request body. Is either a OrderItemResource - type or a IO type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + 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.v2021_12_01.models.OrderItemResource] + :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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2860,12 +2665,13 @@ def begin_create_order_item( 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) + deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -2875,22 +2681,20 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return LROPoller[_models.OrderItemResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements + def _delete_order_item_by_name_initial( self, order_item_name: str, resource_group_name: str, **kwargs: Any - ) -> None: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2901,38 +2705,42 @@ def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - request = build_delete_order_item_by_name_request( + _request = build_delete_order_item_by_name_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_order_item_by_name_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _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 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) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - _delete_order_item_by_name_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return deserialized # type: ignore @distributed_trace def begin_delete_order_item_by_name( @@ -2945,14 +2753,6 @@ def begin_delete_order_item_by_name( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2960,13 +2760,13 @@ def begin_delete_order_item_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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( # type: ignore + 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, @@ -2975,11 +2775,12 @@ def begin_delete_order_item_by_name( params=_params, **kwargs ) + 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, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -2988,27 +2789,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_order_item_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _update_order_item_initial( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3019,19 +2816,19 @@ def _update_order_item_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(order_item_update_parameter, (IO, bytes)): + if isinstance(order_item_update_parameter, (IOBase, bytes)): _content = order_item_update_parameter else: _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") - request = build_update_order_item_request( + _request = build_update_order_item_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -3040,36 +2837,34 @@ def _update_order_item_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_order_item_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response 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) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized + return cls(pipeline_response, deserialized, {}) # type: ignore - _update_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + return deserialized # type: ignore @overload def begin_update_order_item( @@ -3090,26 +2885,16 @@ def begin_update_order_item( 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.v2021_12_01.models.OrderItemUpdateParameter + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3118,7 +2903,7 @@ def begin_update_order_item( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: IO, + order_item_update_parameter: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", @@ -3132,25 +2917,16 @@ def begin_update_order_item( 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 + :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. Default value is "application/json". :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.models.OrderItemResource] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3159,7 +2935,7 @@ def begin_update_order_item( self, order_item_name: str, resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], + order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> LROPoller[_models.OrderItemResource]: @@ -3171,33 +2947,21 @@ def begin_update_order_item( Required. :type resource_group_name: str :param order_item_update_parameter: order item update parameters from request body. Is either a - OrderItemUpdateParameter type or a IO type. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO + 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 - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource] + :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 {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3216,12 +2980,13 @@ def begin_update_order_item( 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) + deserialized = self._deserialize("OrderItemResource", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: @@ -3231,17 +2996,15 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } + 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 @@ -3261,11 +3024,10 @@ def cancel_order_item( # pylint: disable=inconsistent-return-statements Required. :type resource_group_name: str :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -3276,7 +3038,7 @@ def cancel_order_item( # pylint: disable=inconsistent-return-statements self, order_item_name: str, resource_group_name: str, - cancellation_reason: IO, + cancellation_reason: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3289,11 +3051,10 @@ def cancel_order_item( # pylint: disable=inconsistent-return-statements Required. :type resource_group_name: str :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -3304,7 +3065,7 @@ def cancel_order_item( # pylint: disable=inconsistent-return-statements self, order_item_name: str, resource_group_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], + cancellation_reason: Union[_models.CancellationReason, IO[bytes]], **kwargs: Any ) -> None: """Cancel order item. @@ -3315,17 +3076,13 @@ def cancel_order_item( # pylint: disable=inconsistent-return-statements Required. :type resource_group_name: str :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response + 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 = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3336,19 +3093,19 @@ def cancel_order_item( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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, (IO, bytes)): + if isinstance(cancellation_reason, (IOBase, bytes)): _content = cancellation_reason else: _json = self._serialize.body(cancellation_reason, "CancellationReason") - request = build_cancel_order_item_request( + _request = build_cancel_order_item_request( order_item_name=order_item_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, @@ -3356,15 +3113,14 @@ def cancel_order_item( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, content=_content, - template_url=self.cancel_order_item.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _request.url = self._client.format_url(_request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -3375,20 +3131,16 @@ def cancel_order_item( # pylint: disable=inconsistent-return-statements raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, None, {}) - - cancel_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" - } + return cls(pipeline_response, None, {}) # type: ignore - def _return_order_item_initial( # pylint: disable=inconsistent-return-statements + def _return_order_item_initial( self, order_item_name: str, resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO[bytes]], **kwargs: Any - ) -> None: - error_map = { + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3399,19 +3151,19 @@ def _return_order_item_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(return_order_item_details, (IO, bytes)): + if isinstance(return_order_item_details, (IOBase, bytes)): _content = return_order_item_details else: _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") - request = build_return_order_item_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, @@ -3419,30 +3171,34 @@ def _return_order_item_initial( # pylint: disable=inconsistent-return-statement content_type=content_type, json=_json, content=_content, - template_url=self._return_order_item_initial.metadata["url"], headers=_headers, params=_params, ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + _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=False, **kwargs + _request, stream=_stream, **kwargs ) response = pipeline_response.http_response 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) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - _return_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } + return deserialized # type: ignore @overload def begin_return_order_item( @@ -3462,19 +3218,10 @@ def begin_return_order_item( Required. :type resource_group_name: str :param return_order_item_details: Return order item CurrentStatus. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3485,7 +3232,7 @@ def begin_return_order_item( self, order_item_name: str, resource_group_name: str, - return_order_item_details: IO, + return_order_item_details: IO[bytes], *, content_type: str = "application/json", **kwargs: Any @@ -3498,18 +3245,10 @@ def begin_return_order_item( Required. :type resource_group_name: str :param return_order_item_details: Return order item CurrentStatus. Required. - :type return_order_item_details: IO + :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3520,7 +3259,7 @@ def begin_return_order_item( self, order_item_name: str, resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], + return_order_item_details: Union[_models.ReturnOrderItemDetails, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Return order item. @@ -3531,20 +3270,9 @@ def begin_return_order_item( Required. :type resource_group_name: str :param return_order_item_details: Return order item CurrentStatus. Is either a - ReturnOrderItemDetails type or a IO type. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. + 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] :raises ~azure.core.exceptions.HttpResponseError: @@ -3552,14 +3280,14 @@ def begin_return_order_item( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) + 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( # type: ignore + 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, @@ -3570,11 +3298,12 @@ def begin_return_order_item( params=_params, **kwargs ) + 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, {}) + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -3583,14 +3312,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller.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(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_return_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_patch.py similarity index 100% rename from sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_patch.py rename to sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/operations/_patch.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/__init__.py deleted file mode 100644 index cf345f5e5ed1..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._edge_order_management_client import EdgeOrderManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EdgeOrderManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_configuration.py deleted file mode 100644 index 555ae3a0bb31..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_configuration.py +++ /dev/null @@ -1,72 +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 sys -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for EdgeOrderManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2020-12-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2020-12-01-preview"] = kwargs.pop("api_version", "2020-12-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_edge_order_management_client.py deleted file mode 100644 index 61722abc6e42..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_edge_order_management_client.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import EdgeOrderManagementClientConfiguration -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 "2020-12-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = EdgeOrderManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "EdgeOrderManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_metadata.json b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_metadata.json deleted file mode 100644 index d0504ad2a65a..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_metadata.json +++ /dev/null @@ -1,479 +0,0 @@ -{ - "chosen_version": "2020-12-01-preview", - "total_api_version_list": ["2020-12-01-preview"], - "client": { - "name": "EdgeOrderManagementClient", - "filename": "_edge_order_management_client", - "description": "The EdgeOrder Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The ID of the target subscription. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The ID of the target subscription. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"azurecore\": {\"azure.core.paging\": [\"ItemPaged\"], \"azure.core.polling\": [\"LROPoller\"]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"azurecore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"], \"azure.core.polling\": [\"AsyncLROPoller\"]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "operations": { - "list_operations" : { - "sync": { - "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.Operation\"]:\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Operation or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Operation]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "**kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.Operation\"]:\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Operation or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Operation]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "**kwargs" - } - }, - "list_addresses_at_subscription_level" : { - "sync": { - "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "filter, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "filter, skip_token, **kwargs" - } - }, - "list_product_families" : { - "sync": { - "signature": "def list_product_families(\n self,\n product_families_request: Union[_models.ProductFamiliesRequest, IO],\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ProductFamily\"]:\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families. Is either a\n ProductFamiliesRequest type or a IO type. Required.\n:type product_families_request:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest or IO\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product. Default value is None.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamily or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "product_families_request, expand, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_product_families(\n self,\n product_families_request: Union[_models.ProductFamiliesRequest, IO],\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ProductFamily\"]:\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families. Is either a\n ProductFamiliesRequest type or a IO type. Required.\n:type product_families_request:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest or IO\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product. Default value is None.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamily or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "product_families_request, expand, skip_token, **kwargs" - } - }, - "list_configurations" : { - "sync": { - "signature": "def list_configurations(\n self,\n configurations_request: Union[_models.ConfigurationsRequest, IO],\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.Configuration\"]:\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations. Is either a\n ConfigurationsRequest type or a IO type. Required.\n:type configurations_request:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest or IO\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configuration or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "configurations_request, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_configurations(\n self,\n configurations_request: Union[_models.ConfigurationsRequest, IO],\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.Configuration\"]:\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations. Is either a\n ConfigurationsRequest type or a IO type. Required.\n:type configurations_request:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest or IO\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configuration or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "configurations_request, skip_token, **kwargs" - } - }, - "list_product_families_metadata" : { - "sync": { - "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ProductFamiliesMetadataDetails\"]:\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of\n cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ProductFamiliesMetadataDetails\"]:\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of\n cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "skip_token, **kwargs" - } - }, - "list_order_at_subscription_level" : { - "sync": { - "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderResource\"]:\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderResource\"]:\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "skip_token, **kwargs" - } - }, - "list_order_items_at_subscription_level" : { - "sync": { - "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "filter, expand, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "filter, expand, skip_token, **kwargs" - } - }, - "list_addresses_at_resource_group_level" : { - "sync": { - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, filter, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, filter, skip_token, **kwargs" - } - }, - "get_address_by_name" : { - "sync": { - "signature": "def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e _models.AddressResource:\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e _models.AddressResource:\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - } - }, - "_create_address_initial" : { - "sync": { - "signature": "def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_resource, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_resource, **kwargs" - } - }, - "begin_create_address" : { - "sync": { - "signature": "def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e LROPoller[_models.AddressResource]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_resource, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.AddressResource]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address cannot be updated with\nthis API and should instead be updated with the Update address API.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_resource, **kwargs" - } - }, - "_delete_address_by_name_initial" : { - "sync": { - "signature": "def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - } - }, - "begin_delete_address_by_name" : { - "sync": { - "signature": "def begin_delete_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_delete_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - } - }, - "_update_address_initial" : { - "sync": { - "signature": "def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" - } - }, - "begin_update_address" : { - "sync": { - "signature": "def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[_models.AddressResource]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.AddressResource]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" - } - }, - "list_order_at_resource_group_level" : { - "sync": { - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderResource\"]:\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderResource\"]:\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, skip_token, **kwargs" - } - }, - "get_order_by_name" : { - "sync": { - "signature": "def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e _models.OrderResource:\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order. Required.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param location: The name of Azure region. Required.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_name, resource_group_name, location, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e _models.OrderResource:\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order. Required.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param location: The name of Azure region. Required.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_name, resource_group_name, location, **kwargs" - } - }, - "list_order_items_at_resource_group_level" : { - "sync": { - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, filter, expand, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, filter, expand, skip_token, **kwargs" - } - }, - "get_order_item_by_name" : { - "sync": { - "signature": "def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e _models.OrderItemResource:\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, expand, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e _models.OrderItemResource:\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, expand, **kwargs" - } - }, - "_create_order_item_initial" : { - "sync": { - "signature": "def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" - } - }, - "begin_create_order_item" : { - "sync": { - "signature": "def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e LROPoller[_models.OrderItemResource]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.OrderItemResource]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" - } - }, - "_delete_order_item_by_name_initial" : { - "sync": { - "signature": "def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, **kwargs" - } - }, - "begin_delete_order_item_by_name" : { - "sync": { - "signature": "def begin_delete_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_delete_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, **kwargs" - } - }, - "_update_order_item_initial" : { - "sync": { - "signature": "def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" - } - }, - "begin_update_order_item" : { - "sync": { - "signature": "def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[_models.OrderItemResource]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.OrderItemResource]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" - } - }, - "cancel_order_item" : { - "sync": { - "signature": "def cancel_order_item( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: Union[_models.CancellationReason, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a\n IO type. Required.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, cancellation_reason, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def cancel_order_item( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: Union[_models.CancellationReason, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a\n IO type. Required.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason\n or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, cancellation_reason, **kwargs" - } - }, - "_return_order_item_initial" : { - "sync": { - "signature": "def _return_order_item_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _return_order_item_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" - } - }, - "begin_return_order_item" : { - "sync": { - "signature": "def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" - } - } - } - } -} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_vendor.py deleted file mode 100644 index 7f8e08518951..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import EdgeOrderManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -class EdgeOrderManagementClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "PipelineClient" - _config: EdgeOrderManagementClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_version.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_version.py deleted file mode 100644 index e32dc6ec4218..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0b1" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/__init__.py deleted file mode 100644 index b9eec9b0ea44..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._edge_order_management_client import EdgeOrderManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EdgeOrderManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_configuration.py deleted file mode 100644 index bf2580b269e9..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_configuration.py +++ /dev/null @@ -1,72 +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 sys -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for EdgeOrderManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2020-12-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2020-12-01-preview"] = kwargs.pop("api_version", "2020-12-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_edge_order_management_client.py deleted file mode 100644 index abf5d0cdf469..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/_edge_order_management_client.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import 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 "2020-12-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = EdgeOrderManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "EdgeOrderManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_edge_order_management_client_operations.py deleted file mode 100644 index 0f10a5bb5943..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/aio/operations/_edge_order_management_client_operations.py +++ /dev/null @@ -1,2963 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._edge_order_management_client_operations import ( - build_cancel_order_item_request, - build_create_address_request, - build_create_order_item_request, - build_delete_address_by_name_request, - build_delete_order_item_by_name_request, - build_get_address_by_name_request, - build_get_order_by_name_request, - build_get_order_item_by_name_request, - build_list_addresses_at_resource_group_level_request, - build_list_addresses_at_subscription_level_request, - build_list_configurations_request, - build_list_operations_request, - build_list_order_at_resource_group_level_request, - build_list_order_at_subscription_level_request, - build_list_order_items_at_resource_group_level_request, - build_list_order_items_at_subscription_level_request, - build_list_product_families_metadata_request, - build_list_product_families_request, - build_return_order_item_request, - build_update_address_request, - build_update_order_item_request, -) -from .._vendor import EdgeOrderManagementClientMixinABC - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class EdgeOrderManagementClientOperationsMixin( - EdgeOrderManagementClientMixinABC -): # pylint: disable=too-many-public-methods - @distributed_trace - def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """This method gets all the operations that are exposed for customer. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_operations_request( - api_version=api_version, - template_url=self.list_operations.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_operations.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} - - @distributed_trace - def list_addresses_at_subscription_level( - self, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_addresses_at_subscription_level_request( - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_addresses_at_subscription_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_addresses_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses" - } - - @overload - def list_product_families( - self, - product_families_request: _models.ProductFamiliesRequest, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamily"]: - """This method provides the list of product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_product_families( - self, - product_families_request: IO, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamily"]: - """This method provides the list of product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_product_families( - self, - product_families_request: Union[_models.ProductFamiliesRequest, IO], - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **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 type. Required. - :type product_families_request: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest or IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(product_families_request, (IO, bytes)): - _content = product_families_request - else: - _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_product_families_request( - subscription_id=self._config.subscription_id, - expand=expand, - skip_token=skip_token, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_product_families.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ProductFamilies", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_product_families.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" - } - - @overload - def list_configurations( - self, - configurations_request: _models.ConfigurationsRequest, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.Configuration"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. - - :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_configurations( - self, - configurations_request: IO, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.Configuration"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. - - :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_configurations( - self, - configurations_request: Union[_models.ConfigurationsRequest, IO], - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.Configuration"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. - - :param configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO type. Required. - :type configurations_request: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest or IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(configurations_request, (IO, bytes)): - _content = configurations_request - else: - _json = self._serialize.body(configurations_request, "ConfigurationsRequest") - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_configurations_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_configurations.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("Configurations", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_configurations.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_product_families_metadata_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_product_families_metadata.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_product_families_metadata.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 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, - template_url=self.list_order_at_subscription_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_order_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders" - } - - @distributed_trace - def list_order_items_at_subscription_level( - self, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_order_items_at_subscription_level_request( - subscription_id=self._config.subscription_id, - filter=filter, - expand=expand, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_order_items_at_subscription_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_order_items_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems" - } - - @distributed_trace - def list_addresses_at_resource_group_level( - self, resource_group_name: str, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.AddressResource"]: - """Lists all the addresses available under the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - 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, - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_addresses_at_resource_group_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_addresses_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" - } - - @distributed_trace_async - async def get_address_by_name( - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.AddressResource: - """Gets information about the specified address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - - request = build_get_address_by_name_request( - address_name=address_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_address_by_name.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_address_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - async def _create_address_initial( - self, - address_name: str, - resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_resource, (IO, bytes)): - _content = address_resource - else: - _json = self._serialize.body(address_resource, "AddressResource") - - request = build_create_address_request( - address_name=address_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_address_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_address_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @overload - async def begin_create_address( - self, - address_name: str, - resource_group_name: str, - address_resource: _models.AddressResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address cannot be updated with - this API and should instead be updated with the Update address API. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_resource: Address details from request body. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_address( - self, - address_name: str, - resource_group_name: str, - address_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address cannot be updated with - this API and should instead be updated with the Update address API. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_resource: Address details from request body. Required. - :type address_resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_address( - self, - address_name: str, - resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address cannot be updated with - this API and should instead be updated with the Update address API. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_resource: Address details from request body. Is either a AddressResource type or - a IO type. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_address_initial( - address_name=address_name, - resource_group_name=resource_group_name, - address_resource=address_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_address.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - async def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_address_by_name_request( - address_name=address_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_address_by_name_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_address_by_name_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @distributed_trace_async - async def begin_delete_address_by_name( - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_address_by_name_initial( # type: ignore - address_name=address_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_address_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - async def _update_address_initial( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_update_parameter, (IO, bytes)): - _content = address_update_parameter - else: - _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") - - request = build_update_address_request( - address_name=address_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_address_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_address_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @overload - async def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: _models.AddressUpdateParameter, - 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.v2020_12_01_preview.models.AddressUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.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, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Updates the properties of an existing address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Updates the properties of an existing address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. Is either a - AddressUpdateParameter type or a IO type. Required. - :type address_update_parameter: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_address_initial( - address_name=address_name, - resource_group_name=resource_group_name, - address_update_parameter=address_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_address.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @distributed_trace - def list_order_at_resource_group_level( - self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.OrderResource"]: - """Lists order at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. Default value is None. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 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_resource_group_level_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_order_at_resource_group_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_order_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" - } - - @distributed_trace_async - async def get_order_by_name( - self, order_name: str, resource_group_name: str, location: str, **kwargs: Any - ) -> _models.OrderResource: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) - - request = build_get_order_by_name_request( - order_name=order_name, - resource_group_name=resource_group_name, - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_order_by_name.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OrderResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_order_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" - } - - @distributed_trace - def list_order_items_at_resource_group_level( - self, - resource_group_name: str, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResource"]: - """Lists order item at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - 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, - subscription_id=self._config.subscription_id, - filter=filter, - expand=expand, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_order_items_at_resource_group_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_order_items_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" - } - - @distributed_trace_async - async def get_order_item_by_name( - self, order_item_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.OrderItemResource: - """Gets 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 - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - - request = build_get_order_item_by_name_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - template_url=self.get_order_item_by_name.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_order_item_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - async def _create_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_resource, (IO, bytes)): - _content = order_item_resource - else: - _json = self._serialize.body(order_item_resource, "OrderItemResource") - - request = build_create_order_item_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_order_item_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - async def begin_create_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: _models.OrderItemResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Creates an order item. Existing order item cannot be updated with this api and should instead - be updated with the Update order item API. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Creates an order item. Existing order item cannot be updated with this api and should instead - be updated with the Update order item API. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Creates an order item. Existing order item cannot be updated with this api and should instead - be updated with the Update order item API. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_resource: Order item details from request body. Is either a OrderItemResource - type or a IO type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_order_item_initial( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - order_item_resource=order_item_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - async def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements - self, order_item_name: str, resource_group_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_order_item_by_name_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_order_item_by_name_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_order_item_by_name_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @distributed_trace_async - async def begin_delete_order_item_by_name( - self, order_item_name: str, resource_group_name: str, **kwargs: Any - ) -> 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_order_item_by_name_initial( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_order_item_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - async def _update_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_update_parameter, (IO, bytes)): - _content = order_item_update_parameter - else: - _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") - - request = build_update_order_item_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_order_item_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - async def begin_update_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: _models.OrderItemUpdateParameter, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: IO, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. Required. - :type order_item_update_parameter: IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. Is either a - OrderItemUpdateParameter type or a IO type. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - async def cancel_order_item( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: _models.CancellationReason, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Cancel order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel_order_item( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Cancel order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel_order_item( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **kwargs: Any - ) -> None: - """Cancel order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cancellation_reason, (IO, bytes)): - _content = cancellation_reason - else: - _json = self._serialize.body(cancellation_reason, "CancellationReason") - - request = build_cancel_order_item_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.cancel_order_item.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" - } - - async def _return_order_item_initial( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(return_order_item_details, (IO, bytes)): - _content = return_order_item_details - else: - _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") - - request = build_return_order_item_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._return_order_item_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _return_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } - - @overload - async def begin_return_order_item( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: _models.ReturnOrderItemDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. - - :param order_item_name: The name of the order item. 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.v2020_12_01_preview.models.ReturnOrderItemDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_return_order_item( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. Required. - :type return_order_item_details: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_return_order_item( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. Is either a - ReturnOrderItemDetails type or a IO type. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_return_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/__init__.py deleted file mode 100644 index 4097a6229f63..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/__init__.py +++ /dev/null @@ -1,207 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._models_py3 import AddressDetails -from ._models_py3 import AddressProperties -from ._models_py3 import AddressResource -from ._models_py3 import AddressResourceList -from ._models_py3 import AddressUpdateParameter -from ._models_py3 import AvailabilityInformation -from ._models_py3 import BasicInformation -from ._models_py3 import BillingMeterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CommonProperties -from ._models_py3 import Configuration -from ._models_py3 import ConfigurationFilters -from ._models_py3 import ConfigurationProperties -from ._models_py3 import Configurations -from ._models_py3 import ConfigurationsRequest -from ._models_py3 import ContactDetails -from ._models_py3 import CostInformation -from ._models_py3 import CustomerSubscriptionDetails -from ._models_py3 import CustomerSubscriptionRegisteredFeatures -from ._models_py3 import Description -from ._models_py3 import DeviceDetails -from ._models_py3 import Dimensions -from ._models_py3 import DisplayInfo -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import FilterableProperty -from ._models_py3 import ForwardShippingDetails -from ._models_py3 import HierarchyInformation -from ._models_py3 import ImageInformation -from ._models_py3 import Link -from ._models_py3 import ManagementResourcePreferences -from ._models_py3 import MeterDetails -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import OrderItemDetails -from ._models_py3 import OrderItemResource -from ._models_py3 import OrderItemResourceList -from ._models_py3 import OrderItemUpdateParameter -from ._models_py3 import OrderResource -from ._models_py3 import OrderResourceList -from ._models_py3 import Pav2MeterDetails -from ._models_py3 import Preferences -from ._models_py3 import Product -from ._models_py3 import ProductDetails -from ._models_py3 import ProductFamilies -from ._models_py3 import ProductFamiliesMetadata -from ._models_py3 import ProductFamiliesMetadataDetails -from ._models_py3 import ProductFamiliesRequest -from ._models_py3 import ProductFamily -from ._models_py3 import ProductFamilyProperties -from ._models_py3 import ProductLine -from ._models_py3 import ProductLineProperties -from ._models_py3 import ProductProperties -from ._models_py3 import ProxyResource -from ._models_py3 import PurchaseMeterDetails -from ._models_py3 import Resource -from ._models_py3 import ResourceIdentity -from ._models_py3 import ResourceProviderDetails -from ._models_py3 import ReturnOrderItemDetails -from ._models_py3 import ReverseShippingDetails -from ._models_py3 import ShippingAddress -from ._models_py3 import ShippingDetails -from ._models_py3 import Specification -from ._models_py3 import StageDetails -from ._models_py3 import SystemData -from ._models_py3 import TrackedResource -from ._models_py3 import TransportPreferences - -from ._edge_order_management_client_enums import ActionStatusEnum -from ._edge_order_management_client_enums import ActionType -from ._edge_order_management_client_enums import AddressType -from ._edge_order_management_client_enums import AvailabilityStage -from ._edge_order_management_client_enums import BillingType -from ._edge_order_management_client_enums import ChargingType -from ._edge_order_management_client_enums import CreatedByType -from ._edge_order_management_client_enums import DescriptionType -from ._edge_order_management_client_enums import DisabledReason -from ._edge_order_management_client_enums import DoubleEncryptionStatus -from ._edge_order_management_client_enums import ImageType -from ._edge_order_management_client_enums import LengthHeightUnit -from ._edge_order_management_client_enums import LinkType -from ._edge_order_management_client_enums import MeteringType -from ._edge_order_management_client_enums import NotificationStageName -from ._edge_order_management_client_enums import OrderItemCancellationEnum -from ._edge_order_management_client_enums import OrderItemReturnEnum -from ._edge_order_management_client_enums import OrderItemType -from ._edge_order_management_client_enums import Origin -from ._edge_order_management_client_enums import StageName -from ._edge_order_management_client_enums import StageStatus -from ._edge_order_management_client_enums import SupportedFilterTypes -from ._edge_order_management_client_enums import TransportShipmentTypes -from ._edge_order_management_client_enums import WeightMeasurementUnit -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AddressDetails", - "AddressProperties", - "AddressResource", - "AddressResourceList", - "AddressUpdateParameter", - "AvailabilityInformation", - "BasicInformation", - "BillingMeterDetails", - "CancellationReason", - "CommonProperties", - "Configuration", - "ConfigurationFilters", - "ConfigurationProperties", - "Configurations", - "ConfigurationsRequest", - "ContactDetails", - "CostInformation", - "CustomerSubscriptionDetails", - "CustomerSubscriptionRegisteredFeatures", - "Description", - "DeviceDetails", - "Dimensions", - "DisplayInfo", - "EncryptionPreferences", - "ErrorAdditionalInfo", - "ErrorDetail", - "ErrorResponse", - "FilterableProperty", - "ForwardShippingDetails", - "HierarchyInformation", - "ImageInformation", - "Link", - "ManagementResourcePreferences", - "MeterDetails", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationListResult", - "OrderItemDetails", - "OrderItemResource", - "OrderItemResourceList", - "OrderItemUpdateParameter", - "OrderResource", - "OrderResourceList", - "Pav2MeterDetails", - "Preferences", - "Product", - "ProductDetails", - "ProductFamilies", - "ProductFamiliesMetadata", - "ProductFamiliesMetadataDetails", - "ProductFamiliesRequest", - "ProductFamily", - "ProductFamilyProperties", - "ProductLine", - "ProductLineProperties", - "ProductProperties", - "ProxyResource", - "PurchaseMeterDetails", - "Resource", - "ResourceIdentity", - "ResourceProviderDetails", - "ReturnOrderItemDetails", - "ReverseShippingDetails", - "ShippingAddress", - "ShippingDetails", - "Specification", - "StageDetails", - "SystemData", - "TrackedResource", - "TransportPreferences", - "ActionStatusEnum", - "ActionType", - "AddressType", - "AvailabilityStage", - "BillingType", - "ChargingType", - "CreatedByType", - "DescriptionType", - "DisabledReason", - "DoubleEncryptionStatus", - "ImageType", - "LengthHeightUnit", - "LinkType", - "MeteringType", - "NotificationStageName", - "OrderItemCancellationEnum", - "OrderItemReturnEnum", - "OrderItemType", - "Origin", - "StageName", - "StageStatus", - "SupportedFilterTypes", - "TransportShipmentTypes", - "WeightMeasurementUnit", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_edge_order_management_client_enums.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_edge_order_management_client_enums.py deleted file mode 100644 index 077ce6077a3a..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_edge_order_management_client_enums.py +++ /dev/null @@ -1,291 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class ActionStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Describes whether the order item is deletable or not.""" - - ALLOWED = "Allowed" - """Allowed flag.""" - NOT_ALLOWED = "NotAllowed" - """Not Allowed flag.""" - - -class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" - - INTERNAL = "Internal" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AvailabilityStage(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current availability stage of the product. Availability stage.""" - - 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.""" - UNAVAILABLE = "Unavailable" - """Product is not available.""" - - -class BillingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represents billing type.""" - - PAV2 = "Pav2" - """PaV2 billing.""" - PURCHASE = "Purchase" - """Purchase billing.""" - - -class ChargingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Charging type.""" - - PER_ORDER = "PerOrder" - """Per order charging type.""" - PER_DEVICE = "PerDevice" - """Per device charging type.""" - - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - - -class DescriptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of description.""" - - BASE = "Base" - """Base description.""" - - -class DisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the product is disabled.""" - - NONE = "None" - """Not disabled.""" - COUNTRY = "Country" - """Not available in the requested country.""" - REGION = "Region" - """Not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - NOT_AVAILABLE = "NotAvailable" - """The product is not yet available.""" - OUT_OF_STOCK = "OutOfStock" - """The product is out of stock.""" - - -class DoubleEncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Double encryption status as entered by the customer. It is compulsory to give this parameter if - the 'Deny' or 'Disabled' policy is configured. - """ - - DISABLED = "Disabled" - """Double encryption is disabled""" - ENABLED = "Enabled" - """Double encryption is enabled""" - - -class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the image.""" - - MAIN_IMAGE = "MainImage" - """Main image.""" - BULLET_IMAGE = "BulletImage" - """Bullet image.""" - GENERIC_IMAGE = "GenericImage" - """Generic image.""" - - -class LengthHeightUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Unit for the dimensions of length, height and width.""" - - IN = "IN" - """Inch, applicable for West US.""" - CM = "CM" - """Centimeter.""" - - -class LinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of link.""" - - GENERIC = "Generic" - """Generic link.""" - TERMS_AND_CONDITIONS = "TermsAndConditions" - """Terms and conditions link.""" - SPECIFICATION = "Specification" - """Link to product specification.""" - DOCUMENTATION = "Documentation" - """Link to product documentation""" - KNOW_MORE = "KnowMore" - """Link to know more""" - SIGN_UP = "SignUp" - """Link to sign up for products""" - - -class MeteringType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represents Metering type (eg one-time or recurrent).""" - - ONE_TIME = "OneTime" - """One time billing.""" - RECURRING = "Recurring" - """Recurring billing.""" - ADHOC = "Adhoc" - """Adhoc billing.""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - SHIPPED = "Shipped" - """Notification at order item shipped from microsoft datacenter.""" - DELIVERED = "Delivered" - """Notification at order item delivered to customer.""" - - -class OrderItemCancellationEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Describes whether the order item is cancellable or not.""" - - CANCELLABLE = "Cancellable" - """Order item can be cancelled without fee.""" - CANCELLABLE_WITH_FEE = "CancellableWithFee" - """Order item can be cancelled with fee.""" - NOT_CANCELLABLE = "NotCancellable" - """Order item not cancellable.""" - - -class OrderItemReturnEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Describes whether the order item is returnable or not.""" - - RETURNABLE = "Returnable" - """Order item can be returned without fee.""" - RETURNABLE_WITH_FEE = "ReturnableWithFee" - """Order item can be returned with fee.""" - NOT_RETURNABLE = "NotReturnable" - """Order item not returnable.""" - - -class OrderItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Order item type.""" - - PURCHASE = "Purchase" - """Purchase OrderItem.""" - RENTAL = "Rental" - """Rental OrderItem.""" - - -class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stage name.""" - - PLACED = "Placed" - """Currently in draft mode and can still be cancelled""" - IN_REVIEW = "InReview" - """Order is currently in draft mode and can still be cancelled""" - CONFIRMED = "Confirmed" - """Order is confirmed""" - READY_TO_SHIP = "ReadyToShip" - """Order is ready to ship""" - SHIPPED = "Shipped" - """Order is in transit to customer""" - DELIVERED = "Delivered" - """Order is delivered to customer""" - IN_USE = "InUse" - """Order is in use at customer site""" - RETURN_INITIATED = "ReturnInitiated" - """Return has been initiated by customer.""" - RETURN_PICKED_UP = "ReturnPickedUp" - """Order is in transit from customer to microsoft.""" - RETURNED_TO_MICROSOFT = "ReturnedToMicrosoft" - """Order has been received back to microsoft.""" - RETURN_COMPLETED = "ReturnCompleted" - """Return has now completed.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stage status.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - - -class SupportedFilterTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of product filter.""" - - SHIP_TO_COUNTRIES = "ShipToCountries" - """Ship to country""" - DOUBLE_ENCRYPTION_STATUS = "DoubleEncryptionStatus" - """Double encryption status""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates Shipment Logistics type that the customer preferred.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class WeightMeasurementUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Unit for the dimensions of weight.""" - - LBS = "LBS" - """Pounds.""" - KGS = "KGS" - """Kilograms.""" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py deleted file mode 100644 index 8b5beec7cf03..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py +++ /dev/null @@ -1,3237 +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 Azure. - - :ivar forward_address: Customer address and contact details. It should be address resource. - Required. - :vartype forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - :ivar return_address: Return shipping address. - :vartype return_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - """ - - _validation = { - "forward_address": {"required": True}, - "return_address": {"readonly": True}, - } - - _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.v2020_12_01_preview.models.AddressProperties - """ - super().__init__(**kwargs) - self.forward_address = forward_address - self.return_address = None - - -class AddressProperties(_serialization.Model): - """Address Properties. - - All required parameters must be populated in order to send to Azure. - - :ivar shipping_address: Shipping details for the address. - :vartype shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress - :ivar contact_details: Contact details for the address. Required. - :vartype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails - """ - - _validation = { - "contact_details": {"required": True}, - } - - _attribute_map = { - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - } - - 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.v2020_12_01_preview.models.ShippingAddress - :keyword contact_details: Contact details for the address. Required. - :paramtype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails - """ - super().__init__(**kwargs) - self.shipping_address = shipping_address - self.contact_details = contact_details - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class AddressResource(TrackedResource): - """Address Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SystemData - :ivar shipping_address: Shipping details for the address. - :vartype shipping_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ShippingAddress - :ivar contact_details: Contact details for the address. Required. - :vartype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "system_data": {"readonly": True}, - "contact_details": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, - "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, - } - - def __init__( - self, - *, - 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.v2020_12_01_preview.models.ShippingAddress - :keyword contact_details: Contact details for the address. Required. - :paramtype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails - """ - super().__init__(tags=tags, location=location, **kwargs) - self.system_data = None - self.shipping_address = shipping_address - self.contact_details = contact_details - - -class AddressResourceList(_serialization.Model): - """Address Resource Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of address resources. - :vartype value: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :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.v2020_12_01_preview.models.ShippingAddress - :ivar contact_details: Contact details for the address. - :vartype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, - "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, - } - - 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.v2020_12_01_preview.models.ShippingAddress - :keyword contact_details: Contact details for the address. - :paramtype contact_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ContactDetails - """ - super().__init__(**kwargs) - self.tags = tags - self.shipping_address = shipping_address - self.contact_details = contact_details - - -class AvailabilityInformation(_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.v2020_12_01_preview.models.AvailabilityStage - :ivar disabled_reason: Reason why the product is disabled. Known values are: "None", "Country", - "Region", "Feature", "OfferType", "NoSubscriptionInfo", "NotAvailable", and "OutOfStock". - :vartype disabled_reason: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DisabledReason - :ivar disabled_reason_message: Message for why the product is disabled. - :vartype disabled_reason_message: str - """ - - _validation = { - "availability_stage": {"readonly": True}, - "disabled_reason": {"readonly": True}, - "disabled_reason_message": {"readonly": True}, - } - - _attribute_map = { - "availability_stage": {"key": "availabilityStage", "type": "str"}, - "disabled_reason": {"key": "disabledReason", "type": "str"}, - "disabled_reason_message": {"key": "disabledReasonMessage", "type": "str"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.MeterDetails - :ivar metering_type: Represents Metering type (eg one-time or recurrent). Known values are: - "OneTime", "Recurring", and "Adhoc". - :vartype metering_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.MeteringType - :ivar frequency: Frequency of recurrence. - :vartype frequency: str - """ - - _validation = { - "name": {"readonly": True}, - "meter_details": {"readonly": True}, - "metering_type": {"readonly": True}, - "frequency": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "meter_details": {"key": "meterDetails", "type": "MeterDetails"}, - "metering_type": {"key": "meteringType", "type": "str"}, - "frequency": {"key": "frequency", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.meter_details = None - self.metering_type = None - self.frequency = None - - -class CancellationReason(_serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :ivar reason: Reason for cancellation. Required. - :vartype reason: str - """ - - _validation = { - "reason": {"required": True}, - } - - _attribute_map = { - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: str, **kwargs: Any) -> None: - """ - :keyword reason: Reason for cancellation. Required. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.reason = reason - - -class CommonProperties(BasicInformation): - """Represents common properties across product hierarchy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Dimensions - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "specifications": {"readonly": True}, - "dimensions": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "specifications": {"key": "properties.specifications", "type": "[Specification]"}, - "dimensions": {"key": "properties.dimensions", "type": "Dimensions"}, - } - - def __init__(self, **kwargs: 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 Azure. - - :ivar hierarchy_information: Product hierarchy information. Required. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_property: Filters specific to product. - :vartype filterable_property: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - """ - - _validation = { - "hierarchy_information": {"required": True}, - } - - _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.v2020_12_01_preview.models.HierarchyInformation - :keyword filterable_property: Filters specific to product. - :paramtype filterable_property: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - """ - super().__init__(**kwargs) - self.hierarchy_information = hierarchy_information - self.filterable_property = filterable_property - - -class ConfigurationProperties(CommonProperties): - """Properties of configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Dimensions - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "specifications": {"readonly": True}, - "dimensions": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - "specifications": {"key": "specifications", "type": "[Specification]"}, - "dimensions": {"key": "dimensions", "type": "Dimensions"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.Configuration] - :ivar next_link: Link for the next set of configurations. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Configuration]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword next_link: Link for the next set of configurations. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class ConfigurationsRequest(_serialization.Model): - """Configuration request object. - - All required parameters must be populated in order to send to Azure. - - :ivar configuration_filters: Holds details about product hierarchy information and filterable - property. Required. - :vartype configuration_filters: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationFilters] - :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.v2020_12_01_preview.models.CustomerSubscriptionDetails - """ - - _validation = { - "configuration_filters": {"required": True, "unique": True}, - } - - _attribute_map = { - "configuration_filters": {"key": "configurationFilters", "type": "[ConfigurationFilters]"}, - "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, - } - - def __init__( - self, - *, - configuration_filters: List["_models.ConfigurationFilters"], - customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword configuration_filters: Holds details about product hierarchy information and - filterable property. Required. - :paramtype configuration_filters: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationFilters] - :keyword customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :paramtype customer_subscription_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionDetails - """ - super().__init__(**kwargs) - self.configuration_filters = configuration_filters - self.customer_subscription_details = customer_subscription_details - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :ivar contact_name: Contact name of the person. Required. - :vartype contact_name: str - :ivar phone: Phone number of the contact person. Required. - :vartype phone: str - :ivar phone_extension: Phone extension number of the contact person. - :vartype phone_extension: str - :ivar mobile: Mobile number of the contact person. - :vartype mobile: str - :ivar email_list: List of Email-ids to be notified about job progress. Required. - :vartype email_list: list[str] - """ - - _validation = { - "contact_name": {"required": True}, - "phone": {"required": True}, - "email_list": {"required": True}, - } - - _attribute_map = { - "contact_name": {"key": "contactName", "type": "str"}, - "phone": {"key": "phone", "type": "str"}, - "phone_extension": {"key": "phoneExtension", "type": "str"}, - "mobile": {"key": "mobile", "type": "str"}, - "email_list": {"key": "emailList", "type": "[str]"}, - } - - def __init__( - self, - *, - contact_name: str, - phone: str, - email_list: List[str], - phone_extension: Optional[str] = None, - mobile: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_name: Contact name of the person. Required. - :paramtype contact_name: str - :keyword phone: Phone number of the contact person. Required. - :paramtype phone: str - :keyword phone_extension: Phone extension number of the contact person. - :paramtype phone_extension: str - :keyword mobile: Mobile number of the contact person. - :paramtype mobile: str - :keyword email_list: List of Email-ids to be notified about job progress. Required. - :paramtype email_list: list[str] - """ - super().__init__(**kwargs) - self.contact_name = contact_name - self.phone = phone - self.phone_extension = phone_extension - self.mobile = mobile - self.email_list = email_list - - -class CostInformation(_serialization.Model): - """Cost information for the product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar billing_meter_details: Details on the various billing aspects for the product system. - :vartype billing_meter_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingMeterDetails] - :ivar billing_info_url: Default url to display billing information. - :vartype billing_info_url: str - """ - - _validation = { - "billing_meter_details": {"readonly": True}, - "billing_info_url": {"readonly": True}, - } - - _attribute_map = { - "billing_meter_details": {"key": "billingMeterDetails", "type": "[BillingMeterDetails]"}, - "billing_info_url": {"key": "billingInfoUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.billing_meter_details = None - self.billing_info_url = None - - -class CustomerSubscriptionDetails(_serialization.Model): - """Holds Customer subscription details. Clients can display available products to unregistered - customers by explicitly passing subscription details. - - All required parameters must be populated in order to send to Azure. - - :ivar registered_features: List of registered feature flags for subscription. - :vartype registered_features: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionRegisteredFeatures] - :ivar location_placement_id: Location placement Id of a subscription. - :vartype location_placement_id: str - :ivar quota_id: Quota ID of a subscription. Required. - :vartype quota_id: str - """ - - _validation = { - "quota_id": {"required": True}, - } - - _attribute_map = { - "registered_features": {"key": "registeredFeatures", "type": "[CustomerSubscriptionRegisteredFeatures]"}, - "location_placement_id": {"key": "locationPlacementId", "type": "str"}, - "quota_id": {"key": "quotaId", "type": "str"}, - } - - def __init__( - self, - *, - quota_id: str, - registered_features: Optional[List["_models.CustomerSubscriptionRegisteredFeatures"]] = None, - location_placement_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword registered_features: List of registered feature flags for subscription. - :paramtype registered_features: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionRegisteredFeatures] - :keyword location_placement_id: Location placement Id of a subscription. - :paramtype location_placement_id: str - :keyword quota_id: Quota ID of a subscription. Required. - :paramtype quota_id: str - """ - super().__init__(**kwargs) - self.registered_features = registered_features - self.location_placement_id = location_placement_id - self.quota_id = quota_id - - -class CustomerSubscriptionRegisteredFeatures(_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.v2020_12_01_preview.models.DescriptionType - :ivar short_description: Short description of the product system. - :vartype short_description: str - :ivar long_description: Long description of the product system. - :vartype long_description: str - :ivar keywords: Keywords for the product system. - :vartype keywords: list[str] - :ivar attributes: Attributes for the product system. - :vartype attributes: list[str] - :ivar links: Links for the product system. - :vartype links: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Link] - """ - - _validation = { - "description_type": {"readonly": True}, - "short_description": {"readonly": True}, - "long_description": {"readonly": True}, - "keywords": {"readonly": True}, - "attributes": {"readonly": True}, - "links": {"readonly": True}, - } - - _attribute_map = { - "description_type": {"key": "descriptionType", "type": "str"}, - "short_description": {"key": "shortDescription", "type": "str"}, - "long_description": {"key": "longDescription", "type": "str"}, - "keywords": {"key": "keywords", "type": "[str]"}, - "attributes": {"key": "attributes", "type": "[str]"}, - "links": {"key": "links", "type": "[Link]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.description_type = None - self.short_description = None - self.long_description = None - self.keywords = None - self.attributes = None - self.links = None - - -class DeviceDetails(_serialization.Model): - """Device details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar serial_number: device serial number. - :vartype serial_number: str - :ivar management_resource_id: Management Resource Id. - :vartype management_resource_id: str - :ivar management_resource_tenant_id: Management Resource Tenant ID. - :vartype management_resource_tenant_id: str - """ - - _validation = { - "serial_number": {"readonly": True}, - "management_resource_id": {"readonly": True}, - "management_resource_tenant_id": {"readonly": True}, - } - - _attribute_map = { - "serial_number": {"key": "serialNumber", "type": "str"}, - "management_resource_id": {"key": "managementResourceId", "type": "str"}, - "management_resource_tenant_id": {"key": "managementResourceTenantId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.management_resource_id = None - self.management_resource_tenant_id = None - - -class Dimensions(_serialization.Model): - """Dimensions of a configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar length: Length of the device. - :vartype length: float - :ivar height: Height of the device. - :vartype height: float - :ivar width: Width of the device. - :vartype width: float - :ivar length_height_unit: Unit for the dimensions of length, height and width. Known values - are: "IN" and "CM". - :vartype length_height_unit: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.LengthHeightUnit - :ivar weight: Weight of the device. - :vartype weight: float - :ivar depth: Depth of the device. - :vartype depth: float - :ivar weight_unit: Unit for the dimensions of weight. Known values are: "LBS" and "KGS". - :vartype weight_unit: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.WeightMeasurementUnit - """ - - _validation = { - "length": {"readonly": True}, - "height": {"readonly": True}, - "width": {"readonly": True}, - "length_height_unit": {"readonly": True}, - "weight": {"readonly": True}, - "depth": {"readonly": True}, - "weight_unit": {"readonly": True}, - } - - _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.v2020_12_01_preview.models.DoubleEncryptionStatus - """ - - _attribute_map = { - "double_encryption_status": {"key": "doubleEncryptionStatus", "type": "str"}, - } - - def __init__( - self, *, double_encryption_status: Optional[Union[str, "_models.DoubleEncryptionStatus"]] = None, **kwargs: Any - ) -> None: - """ - :keyword double_encryption_status: Double encryption status as entered by the customer. It is - compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known - values are: "Disabled" and "Enabled". - :paramtype double_encryption_status: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DoubleEncryptionStatus - """ - super().__init__(**kwargs) - self.double_encryption_status = double_encryption_status - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class FilterableProperty(_serialization.Model): - """Different types of filters supported and its values. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Type of product filter. Required. Known values are: "ShipToCountries" and - "DoubleEncryptionStatus". - :vartype type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SupportedFilterTypes - :ivar supported_values: Values to be filtered. Required. - :vartype supported_values: list[str] - """ - - _validation = { - "type": {"required": True}, - "supported_values": {"required": True}, - } - - _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.v2020_12_01_preview.models.SupportedFilterTypes - :keyword supported_values: Values to be filtered. Required. - :paramtype supported_values: list[str] - """ - super().__init__(**kwargs) - self.type = type - self.supported_values = supported_values - - -class ForwardShippingDetails(_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.v2020_12_01_preview.models.ImageType - :ivar image_url: Url of the image. - :vartype image_url: str - """ - - _validation = { - "image_type": {"readonly": True}, - "image_url": {"readonly": True}, - } - - _attribute_map = { - "image_type": {"key": "imageType", "type": "str"}, - "image_url": {"key": "imageUrl", "type": "str"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.LinkType - :ivar link_url: Url of the link. - :vartype link_url: str - """ - - _validation = { - "link_type": {"readonly": True}, - "link_url": {"readonly": True}, - } - - _attribute_map = { - "link_type": {"key": "linkType", "type": "str"}, - "link_url": {"key": "linkUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.link_type = None - self.link_url = None - - -class ManagementResourcePreferences(_serialization.Model): - """Management resource preference to link device. - - :ivar preferred_management_resource_id: Customer preferred Management resource ARM ID. - :vartype preferred_management_resource_id: str - """ - - _attribute_map = { - "preferred_management_resource_id": {"key": "preferredManagementResourceId", "type": "str"}, - } - - def __init__(self, *, preferred_management_resource_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword preferred_management_resource_id: Customer preferred Management resource ARM ID. - :paramtype preferred_management_resource_id: str - """ - super().__init__(**kwargs) - self.preferred_management_resource_id = preferred_management_resource_id - - -class MeterDetails(_serialization.Model): - """Holds details about billing type and its meter guids. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - Pav2MeterDetails, PurchaseMeterDetails - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". - :vartype billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ChargingType - """ - - _validation = { - "billing_type": {"required": True}, - "multiplier": {"readonly": True}, - "charging_type": {"readonly": True}, - } - - _attribute_map = { - "billing_type": {"key": "billingType", "type": "str"}, - "multiplier": {"key": "multiplier", "type": "float"}, - "charging_type": {"key": "chargingType", "type": "str"}, - } - - _subtype_map = {"billing_type": {"Pav2": "Pav2MeterDetails", "Purchase": "PurchaseMeterDetails"}} - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.billing_type: Optional[str] = None - self.multiplier = None - self.charging_type = None - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :ivar stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". - :vartype stage_name: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.NotificationStageName - :ivar send_notification: Notification is required or not. Required. - :vartype send_notification: bool - """ - - _validation = { - "stage_name": {"required": True}, - "send_notification": {"required": True}, - } - - _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.v2020_12_01_preview.models.NotificationStageName - :keyword send_notification: Notification is required or not. Required. - :paramtype send_notification: bool - """ - super().__init__(**kwargs) - self.stage_name = stage_name - self.send_notification = send_notification - - -class Operation(_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.v2020_12_01_preview.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ActionType - """ - - _validation = { - "name": {"readonly": True}, - "is_data_action": {"readonly": True}, - "origin": {"readonly": True}, - "action_type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "action_type": {"key": "actionType", "type": "str"}, - } - - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - 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.v2020_12_01_preview.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class OrderItemDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Order item details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar product_details: Unique identifier for configuration. Required. - :vartype product_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductDetails - :ivar order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". - :vartype order_item_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemType - :ivar current_stage: Current Order item Status. - :vartype current_stage: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails - :ivar order_item_stage_history: Order item status history. - :vartype order_item_stage_history: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails] - :ivar preferences: Customer notification Preferences. - :vartype preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences - :ivar forward_shipping_details: Forward Package Shipping details. - :vartype forward_shipping_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ForwardShippingDetails - :ivar reverse_shipping_details: Reverse Package Shipping details. - :vartype reverse_shipping_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReverseShippingDetails - :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.v2020_12_01_preview.models.OrderItemCancellationEnum - :ivar deletion_status: Describes whether the order item is deletable or not. Known values are: - "Allowed" and "NotAllowed". - :vartype deletion_status: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ActionStatusEnum - :ivar return_reason: Return reason. - :vartype return_reason: str - :ivar return_status: Describes whether the order item is returnable or not. Known values are: - "Returnable", "ReturnableWithFee", and "NotReturnable". - :vartype return_status: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemReturnEnum - :ivar management_rp_details: Parent RP details - this returns only the first or default parent - RP from the entire list. - :vartype management_rp_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails - :ivar management_rp_details_list: List of parent RP details supported for configuration. - :vartype management_rp_details_list: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ErrorDetail - """ - - _validation = { - "product_details": {"required": True}, - "order_item_type": {"required": True}, - "current_stage": {"readonly": True}, - "order_item_stage_history": {"readonly": True}, - "forward_shipping_details": {"readonly": True}, - "reverse_shipping_details": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "cancellation_status": {"readonly": True}, - "deletion_status": {"readonly": True}, - "return_reason": {"readonly": True}, - "return_status": {"readonly": True}, - "management_rp_details": {"readonly": True}, - "management_rp_details_list": {"readonly": True}, - "error": {"readonly": True}, - } - - _attribute_map = { - "product_details": {"key": "productDetails", "type": "ProductDetails"}, - "order_item_type": {"key": "orderItemType", "type": "str"}, - "current_stage": {"key": "currentStage", "type": "StageDetails"}, - "order_item_stage_history": {"key": "orderItemStageHistory", "type": "[StageDetails]"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "forward_shipping_details": {"key": "forwardShippingDetails", "type": "ForwardShippingDetails"}, - "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, - "notification_email_list": {"key": "notificationEmailList", "type": "[str]"}, - "cancellation_reason": {"key": "cancellationReason", "type": "str"}, - "cancellation_status": {"key": "cancellationStatus", "type": "str"}, - "deletion_status": {"key": "deletionStatus", "type": "str"}, - "return_reason": {"key": "returnReason", "type": "str"}, - "return_status": {"key": "returnStatus", "type": "str"}, - "management_rp_details": {"key": "managementRpDetails", "type": "ResourceProviderDetails"}, - "management_rp_details_list": {"key": "managementRpDetailsList", "type": "[ResourceProviderDetails]"}, - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__( - self, - *, - 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.v2020_12_01_preview.models.ProductDetails - :keyword order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". - :paramtype order_item_type: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemType - :keyword preferences: Customer notification Preferences. - :paramtype preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences - :keyword notification_email_list: Additional notification email list. - :paramtype notification_email_list: list[str] - """ - super().__init__(**kwargs) - self.product_details = product_details - self.order_item_type = order_item_type - self.current_stage = None - 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 Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SystemData - :ivar order_item_details: Represents order item details. Required. - :vartype order_item_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemDetails - :ivar address_details: Represents shipping and return address for order item. Required. - :vartype address_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressDetails - :ivar start_time: Start time of order item. - :vartype start_time: ~datetime.datetime - :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.v2020_12_01_preview.models.OrderItemDetails - :keyword address_details: Represents shipping and return address for order item. Required. - :paramtype address_details: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressDetails - :keyword order_id: Id of the order to which order item belongs to. Required. - :paramtype order_id: str - """ - super().__init__(tags=tags, location=location, **kwargs) - self.system_data = None - self.order_item_details = order_item_details - self.address_details = address_details - 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.v2020_12_01_preview.models.OrderItemResource] - :ivar next_link: Link for the next set of order item resources. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OrderItemResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword next_link: Link for the next set of order item resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class OrderItemUpdateParameter(_serialization.Model): - """Updates order item parameters. - - :ivar tags: The list of key value pairs that describe the resource. These tags can be used in - viewing and grouping this resource (across resource groups). - :vartype tags: dict[str, str] - :ivar forward_address: Updates forward shipping address and contact details. - :vartype forward_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - :ivar preferences: Customer preference. - :vartype preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences - :ivar notification_email_list: Additional notification email list. - :vartype notification_email_list: list[str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "forward_address": {"key": "properties.forwardAddress", "type": "AddressProperties"}, - "preferences": {"key": "properties.preferences", "type": "Preferences"}, - "notification_email_list": {"key": "properties.notificationEmailList", "type": "[str]"}, - } - - 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.v2020_12_01_preview.models.AddressProperties - :keyword preferences: Customer preference. - :paramtype preferences: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Preferences - :keyword notification_email_list: Additional notification email list. - :paramtype notification_email_list: list[str] - """ - super().__init__(**kwargs) - self.tags = tags - self.forward_address = forward_address - self.preferences = preferences - self.notification_email_list = notification_email_list - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - - -class OrderResource(ProxyResource): - """Specifies the properties or parameters for an order. Order is a grouping of one or more order - items. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.SystemData - :ivar order_item_ids: List of order item ARM Ids which are part of an order. - :vartype order_item_ids: list[str] - :ivar current_stage: Order current status. - :vartype current_stage: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails - :ivar order_stage_history: Order status history. - :vartype order_stage_history: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageDetails] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "order_item_ids": {"readonly": True}, - "current_stage": {"readonly": True}, - "order_stage_history": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "order_item_ids": {"key": "properties.orderItemIds", "type": "[str]"}, - "current_stage": {"key": "properties.currentStage", "type": "StageDetails"}, - "order_stage_history": {"key": "properties.orderStageHistory", "type": "[StageDetails]"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.OrderResource] - :ivar next_link: Link for the next set of order resources. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OrderResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword next_link: Link for the next set of order resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class Pav2MeterDetails(MeterDetails): - """Billing type PAV2 meter details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". - :vartype billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ChargingType - :ivar meter_guid: Validation status of requested data center and transport. - :vartype meter_guid: str - """ - - _validation = { - "billing_type": {"required": True}, - "multiplier": {"readonly": True}, - "charging_type": {"readonly": True}, - "meter_guid": {"readonly": True}, - } - - _attribute_map = { - "billing_type": {"key": "billingType", "type": "str"}, - "multiplier": {"key": "multiplier", "type": "float"}, - "charging_type": {"key": "chargingType", "type": "str"}, - "meter_guid": {"key": "meterGuid", "type": "str"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.NotificationPreference] - :ivar transport_preferences: Preferences related to the shipment logistics of the order. - :vartype transport_preferences: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.EncryptionPreferences - :ivar management_resource_preferences: Preferences related to the Management resource. - :vartype management_resource_preferences: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ManagementResourcePreferences - """ - - _attribute_map = { - "notification_preferences": {"key": "notificationPreferences", "type": "[NotificationPreference]"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, - "management_resource_preferences": { - "key": "managementResourcePreferences", - "type": "ManagementResourcePreferences", - }, - } - - 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.v2020_12_01_preview.models.NotificationPreference] - :keyword transport_preferences: Preferences related to the shipment logistics of the order. - :paramtype transport_preferences: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.EncryptionPreferences - :keyword management_resource_preferences: Preferences related to the Management resource. - :paramtype management_resource_preferences: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ManagementResourcePreferences - """ - super().__init__(**kwargs) - self.notification_preferences = notification_preferences - self.transport_preferences = transport_preferences - self.encryption_preferences = encryption_preferences - self.management_resource_preferences = management_resource_preferences - - -class Product(_serialization.Model): - """List of Products. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "configurations": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "configurations": {"key": "properties.configurations", "type": "[Configuration]"}, - } - - def __init__(self, **kwargs: 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 Azure. - - :ivar display_info: Display details of the product. - :vartype display_info: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DisplayInfo - :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the product. - Required. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar count: Quantity of the product. - :vartype count: int - :ivar product_double_encryption_status: Double encryption status of the configuration. - Read-only field. Known values are: "Disabled" and "Enabled". - :vartype product_double_encryption_status: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DoubleEncryptionStatus - :ivar device_details: list of device details. - :vartype device_details: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.DeviceDetails] - """ - - _validation = { - "hierarchy_information": {"required": True}, - "count": {"readonly": True}, - "product_double_encryption_status": {"readonly": True}, - "device_details": {"readonly": True}, - } - - _attribute_map = { - "display_info": {"key": "displayInfo", "type": "DisplayInfo"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "count": {"key": "count", "type": "int"}, - "product_double_encryption_status": {"key": "productDoubleEncryptionStatus", "type": "str"}, - "device_details": {"key": "deviceDetails", "type": "[DeviceDetails]"}, - } - - def __init__( - self, - *, - hierarchy_information: "_models.HierarchyInformation", - display_info: Optional["_models.DisplayInfo"] = None, - **kwargs: Any - ) -> None: - """ - :keyword display_info: Display details of the product. - :paramtype display_info: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.DisplayInfo - :keyword hierarchy_information: Hierarchy of the product which uniquely identifies the product. - Required. - :paramtype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - """ - super().__init__(**kwargs) - self.display_info = display_info - self.hierarchy_information = hierarchy_information - self.count = None - 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.v2020_12_01_preview.models.ProductFamily] - :ivar next_link: Link for the next set of product families. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ProductFamily]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword next_link: Link for the next set of product families. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class ProductFamiliesMetadata(_serialization.Model): - """Holds details about product family metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of product family metadata details. - :vartype value: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails] - :ivar next_link: Link for the next set of product families. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ProductFamiliesMetadataDetails]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductLine] - :ivar resource_provider_details: Contains details related to resource provider. - :vartype resource_provider_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "product_lines": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, - "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, - } - - def __init__( - self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_provider_details: Contains details related to resource provider. - :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - """ - super().__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - 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 Azure. - - :ivar filterable_properties: Dictionary of filterable properties on product family. Required. - :vartype filterable_properties: dict[str, - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty]] - :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.v2020_12_01_preview.models.CustomerSubscriptionDetails - """ - - _validation = { - "filterable_properties": {"required": True}, - } - - _attribute_map = { - "filterable_properties": {"key": "filterableProperties", "type": "{[FilterableProperty]}"}, - "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, - } - - def __init__( - self, - *, - filterable_properties: Dict[str, List["_models.FilterableProperty"]], - customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword filterable_properties: Dictionary of filterable properties on product family. - Required. - :paramtype filterable_properties: dict[str, - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty]] - :keyword customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :paramtype customer_subscription_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CustomerSubscriptionDetails - """ - super().__init__(**kwargs) - self.filterable_properties = filterable_properties - self.customer_subscription_details = customer_subscription_details - - -class ProductFamily(_serialization.Model): - """Product Family. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductLine] - :ivar resource_provider_details: Contains details related to resource provider. - :vartype resource_provider_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "product_lines": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, - "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, - } - - def __init__( - self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_provider_details: Contains details related to resource provider. - :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - """ - super().__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - 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.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductLine] - :ivar resource_provider_details: Contains details related to resource provider. - :vartype resource_provider_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "product_lines": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - "product_lines": {"key": "productLines", "type": "[ProductLine]"}, - "resource_provider_details": {"key": "resourceProviderDetails", "type": "[ResourceProviderDetails]"}, - } - - def __init__( - self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_provider_details: Contains details related to resource provider. - :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ResourceProviderDetails] - """ - super().__init__(**kwargs) - self.product_lines = None - self.resource_provider_details = resource_provider_details - - -class ProductLine(_serialization.Model): - """Product line. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Product] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "products": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "products": {"key": "properties.products", "type": "[Product]"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Product] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "products": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - "products": {"key": "products", "type": "[Product]"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.HierarchyInformation - :ivar filterable_properties: list of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "configurations": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - "configurations": {"key": "configurations", "type": "[Configuration]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.configurations = None - - -class PurchaseMeterDetails(MeterDetails): - """Billing type Purchase meter details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". - :vartype billing_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ChargingType - :ivar product_id: Product Id. - :vartype product_id: str - :ivar sku_id: Sku Id. - :vartype sku_id: str - :ivar term_id: Term Id. - :vartype term_id: str - """ - - _validation = { - "billing_type": {"required": True}, - "multiplier": {"readonly": True}, - "charging_type": {"readonly": True}, - "product_id": {"readonly": True}, - "sku_id": {"readonly": True}, - "term_id": {"readonly": True}, - } - - _attribute_map = { - "billing_type": {"key": "billingType", "type": "str"}, - "multiplier": {"key": "multiplier", "type": "float"}, - "charging_type": {"key": "chargingType", "type": "str"}, - "product_id": {"key": "productId", "type": "str"}, - "sku_id": {"key": "skuId", "type": "str"}, - "term_id": {"key": "termId", "type": "str"}, - } - - def __init__(self, **kwargs: 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 Azure. - - :ivar return_address: customer return address. - :vartype return_address: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressProperties - :ivar return_reason: Return Reason. Required. - :vartype return_reason: str - :ivar service_tag: Service tag (located on the bottom-right corner of the device). - :vartype service_tag: str - :ivar shipping_box_required: Shipping Box required. - :vartype shipping_box_required: bool - """ - - _validation = { - "return_reason": {"required": True}, - } - - _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.v2020_12_01_preview.models.AddressProperties - :keyword return_reason: Return Reason. Required. - :paramtype return_reason: str - :keyword service_tag: Service tag (located on the bottom-right corner of the device). - :paramtype service_tag: str - :keyword shipping_box_required: Shipping Box required. - :paramtype shipping_box_required: bool - """ - super().__init__(**kwargs) - self.return_address = return_address - self.return_reason = return_reason - self.service_tag = service_tag - self.shipping_box_required = shipping_box_required - - -class ReverseShippingDetails(_serialization.Model): - """Reverse shipment details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sas_key_for_label: SAS key to download the reverse shipment label of the package. - :vartype sas_key_for_label: str - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar carrier_display_name: Carrier Name for display purpose. Not to be used for any - processing. - :vartype carrier_display_name: str - :ivar tracking_id: TrackingId of the package. - :vartype tracking_id: str - :ivar tracking_url: TrackingUrl of the package. - :vartype tracking_url: str - """ - - _validation = { - "sas_key_for_label": {"readonly": True}, - "carrier_name": {"readonly": True}, - "carrier_display_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - "tracking_url": {"readonly": True}, - } - - _attribute_map = { - "sas_key_for_label": {"key": "sasKeyForLabel", "type": "str"}, - "carrier_name": {"key": "carrierName", "type": "str"}, - "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.sas_key_for_label = None - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = None - - -class ShippingAddress(_serialization.Model): - """Shipping address where customer wishes to receive the device. - - All required parameters must be populated in order to send to Azure. - - :ivar street_address1: Street Address line 1. Required. - :vartype street_address1: str - :ivar street_address2: Street Address line 2. - :vartype street_address2: str - :ivar street_address3: Street Address line 3. - :vartype street_address3: str - :ivar city: Name of the City. - :vartype city: str - :ivar state_or_province: Name of the State or Province. - :vartype state_or_province: str - :ivar country: Name of the Country. Required. - :vartype country: str - :ivar postal_code: Postal code. - :vartype postal_code: str - :ivar zip_extended_code: Extended Zip Code. - :vartype zip_extended_code: str - :ivar company_name: Name of the company. - :vartype company_name: str - :ivar address_type: Type of address. Known values are: "None", "Residential", and "Commercial". - :vartype address_type: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressType - """ - - _validation = { - "street_address1": {"required": True}, - "country": {"required": True}, - } - - _attribute_map = { - "street_address1": {"key": "streetAddress1", "type": "str"}, - "street_address2": {"key": "streetAddress2", "type": "str"}, - "street_address3": {"key": "streetAddress3", "type": "str"}, - "city": {"key": "city", "type": "str"}, - "state_or_province": {"key": "stateOrProvince", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "postal_code": {"key": "postalCode", "type": "str"}, - "zip_extended_code": {"key": "zipExtendedCode", "type": "str"}, - "company_name": {"key": "companyName", "type": "str"}, - "address_type": {"key": "addressType", "type": "str"}, - } - - def __init__( - self, - *, - 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.v2020_12_01_preview.models.AddressType - """ - super().__init__(**kwargs) - self.street_address1 = street_address1 - self.street_address2 = street_address2 - self.street_address3 = street_address3 - self.city = city - self.state_or_province = state_or_province - self.country = country - self.postal_code = postal_code - self.zip_extended_code = zip_extended_code - self.company_name = company_name - self.address_type = address_type - - -class 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.v2020_12_01_preview.models.StageStatus - :ivar stage_name: Stage name. Known values are: "Placed", "InReview", "Confirmed", - "ReadyToShip", "Shipped", "Delivered", "InUse", "ReturnInitiated", "ReturnPickedUp", - "ReturnedToMicrosoft", "ReturnCompleted", and "Cancelled". - :vartype stage_name: str or ~azure.mgmt.edgeorder.v2020_12_01_preview.models.StageName - :ivar display_name: Display name of the resource stage. - :vartype display_name: str - :ivar start_time: Stage start time. - :vartype start_time: ~datetime.datetime - """ - - _validation = { - "stage_status": {"readonly": True}, - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "start_time": {"readonly": True}, - } - - _attribute_map = { - "stage_status": {"key": "stageStatus", "type": "str"}, - "stage_name": {"key": "stageName", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "start_time": {"key": "startTime", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: 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.v2020_12_01_preview.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CreatedByType - :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.v2020_12_01_preview.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TransportPreferences(_serialization.Model): - """Preferences related to the shipment logistics of the sku. - - All required parameters must be populated in order to send to Azure. - - :ivar preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. - Required. Known values are: "CustomerManaged" and "MicrosoftManaged". - :vartype preferred_shipment_type: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], **kwargs: Any) -> None: - """ - :keyword preferred_shipment_type: Indicates Shipment Logistics type that the customer - preferred. Required. Known values are: "CustomerManaged" and "MicrosoftManaged". - :paramtype preferred_shipment_type: str or - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_edge_order_management_client_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_edge_order_management_client_operations.py deleted file mode 100644 index 9f8fb6b4edd6..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/operations/_edge_order_management_client_operations.py +++ /dev/null @@ -1,3716 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import EdgeOrderManagementClientMixinABC, _convert_request, _format_url_section - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_operations_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.EdgeOrder/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_addresses_at_subscription_level_request( - subscription_id: str, *, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_product_families_request( - subscription_id: str, *, expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_configurations_request( - subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_product_families_metadata_request( - subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_order_at_subscription_level_request( - subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_order_items_at_subscription_level_request( - subscription_id: str, - *, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_addresses_at_resource_group_level_request( - resource_group_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_address_by_name_request( - address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "addressName": _SERIALIZER.url( - "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_address_request( - address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "addressName": _SERIALIZER.url( - "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_address_by_name_request( - address_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "addressName": _SERIALIZER.url( - "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_address_request( - address_name: str, resource_group_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "addressName": _SERIALIZER.url( - "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_order_at_resource_group_level_request( - resource_group_name: str, subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_order_by_name_request( - order_name: str, resource_group_name: str, location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "orderName": _SERIALIZER.url("order_name", order_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_order_items_at_resource_group_level_request( - resource_group_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_order_item_by_name_request( - order_item_name: str, resource_group_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_order_item_request( - order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_order_item_by_name_request( - order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_order_item_request( - order_item_name: str, - resource_group_name: str, - subscription_id: str, - *, - if_match: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_order_item_request( - order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel", - ) # pylint: disable=line-too-long - path_format_arguments = { - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_return_order_item_request( - order_item_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return", - ) # pylint: disable=line-too-long - path_format_arguments = { - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class EdgeOrderManagementClientOperationsMixin( - EdgeOrderManagementClientMixinABC -): # pylint: disable=too-many-public-methods - @distributed_trace - def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """This method gets all the operations that are exposed for customer. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_operations_request( - api_version=api_version, - template_url=self.list_operations.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_operations.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} - - @distributed_trace - def list_addresses_at_subscription_level( - self, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.AddressResource"]: - """Lists all the addresses available under the subscription. - - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_addresses_at_subscription_level_request( - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_addresses_at_subscription_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_addresses_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses" - } - - @overload - def list_product_families( - self, - product_families_request: _models.ProductFamiliesRequest, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.ProductFamily"]: - """This method provides the list of product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_product_families( - self, - product_families_request: IO, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.ProductFamily"]: - """This method provides the list of product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_product_families( - self, - product_families_request: Union[_models.ProductFamiliesRequest, IO], - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.ProductFamily"]: - """This method provides the list of product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Is either a - ProductFamiliesRequest type or a IO type. Required. - :type product_families_request: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesRequest or IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(product_families_request, (IO, bytes)): - _content = product_families_request - else: - _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_product_families_request( - subscription_id=self._config.subscription_id, - expand=expand, - skip_token=skip_token, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_product_families.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ProductFamilies", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_product_families.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" - } - - @overload - def list_configurations( - self, - configurations_request: _models.ConfigurationsRequest, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.Configuration"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. - - :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_configurations( - self, - configurations_request: IO, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.Configuration"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. - - :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_configurations( - self, - configurations_request: Union[_models.ConfigurationsRequest, IO], - skip_token: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.Configuration"]: - """This method provides the list of configurations for the given product family, product line and - product under subscription. - - :param configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO type. Required. - :type configurations_request: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ConfigurationsRequest or IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(configurations_request, (IO, bytes)): - _content = configurations_request - else: - _json = self._serialize.body(configurations_request, "ConfigurationsRequest") - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_configurations_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_configurations.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("Configurations", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_configurations.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.ProductFamiliesMetadataDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_product_families_metadata_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_product_families_metadata.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_product_families_metadata.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" - } - - @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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 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, - template_url=self.list_order_at_subscription_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_order_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders" - } - - @distributed_trace - def list_order_items_at_subscription_level( - self, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_order_items_at_subscription_level_request( - subscription_id=self._config.subscription_id, - filter=filter, - expand=expand, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_order_items_at_subscription_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_order_items_at_subscription_level.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems" - } - - @distributed_trace - def list_addresses_at_resource_group_level( - self, resource_group_name: str, filter: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.AddressResource"]: - """Lists all the addresses available under the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - 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, - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_addresses_at_resource_group_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_addresses_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" - } - - @distributed_trace - def get_address_by_name( - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.AddressResource: - """Gets information about the specified address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - - request = build_get_address_by_name_request( - address_name=address_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_address_by_name.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_address_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - def _create_address_initial( - self, - address_name: str, - resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_resource, (IO, bytes)): - _content = address_resource - else: - _json = self._serialize.body(address_resource, "AddressResource") - - request = build_create_address_request( - address_name=address_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_address_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_address_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @overload - def begin_create_address( - self, - address_name: str, - resource_group_name: str, - address_resource: _models.AddressResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address cannot be updated with - this API and should instead be updated with the Update address API. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. 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.v2020_12_01_preview.models.AddressResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_address( - self, - address_name: str, - resource_group_name: str, - address_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address cannot be updated with - this API and should instead be updated with the Update address API. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_resource: Address details from request body. Required. - :type address_resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_address( - self, - address_name: str, - resource_group_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Creates a new address with the specified parameters. Existing address cannot be updated with - this API and should instead be updated with the Update address API. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_resource: Address details from request body. Is either a AddressResource type or - a IO type. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_address_initial( - address_name=address_name, - resource_group_name=resource_group_name, - address_resource=address_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_address.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_address_by_name_request( - address_name=address_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_address_by_name_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_address_by_name_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @distributed_trace - def begin_delete_address_by_name( - self, address_name: str, resource_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_address_by_name_initial( # type: ignore - address_name=address_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_address_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - def _update_address_initial( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_update_parameter, (IO, bytes)): - _content = address_update_parameter - else: - _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") - - request = build_update_address_request( - address_name=address_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_address_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_address_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @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.v2020_12_01_preview.models.AddressUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: IO, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Updates the properties of an existing address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_address( - self, - address_name: str, - resource_group_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Updates the properties of an existing address. - - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_update_parameter: Address update parameters from request body. Is either a - AddressUpdateParameter type or a IO type. Required. - :type address_update_parameter: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_address_initial( - address_name=address_name, - resource_group_name=resource_group_name, - address_update_parameter=address_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_address.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @distributed_trace - def list_order_at_resource_group_level( - self, resource_group_name: str, skip_token: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.OrderResource"]: - """Lists order at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param skip_token: $skipToken is supported on Get list of order, which provides the next page - in the list of order. Default value is None. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 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_resource_group_level_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_order_at_resource_group_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_order_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" - } - - @distributed_trace - def get_order_by_name( - self, order_name: 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) - - request = build_get_order_by_name_request( - order_name=order_name, - resource_group_name=resource_group_name, - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get_order_by_name.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OrderResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_order_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" - } - - @distributed_trace - def list_order_items_at_resource_group_level( - self, - resource_group_name: str, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.OrderItemResource"]: - """Lists order item at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - 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, - subscription_id=self._config.subscription_id, - filter=filter, - expand=expand, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_order_items_at_resource_group_level.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_order_items_at_resource_group_level.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" - } - - @distributed_trace - def get_order_item_by_name( - self, order_item_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.OrderItemResource: - """Gets an order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param expand: $expand is supported on device details, forward shipping details and reverse - shipping details parameters. Each of these can be provided as a comma separated list. Device - Details for order item provides details on the devices of the product, Forward and Reverse - Shipping details provide forward and reverse shipping details respectively. Default value is - None. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - - request = build_get_order_item_by_name_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - template_url=self.get_order_item_by_name.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_order_item_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - def _create_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_resource, (IO, bytes)): - _content = order_item_resource - else: - _json = self._serialize.body(order_item_resource, "OrderItemResource") - - request = build_create_order_item_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_order_item_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - def begin_create_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: _models.OrderItemResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Creates an order item. Existing order item cannot be updated with this api and should instead - be updated with the Update order item API. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Creates an order item. Existing order item cannot be updated with this api and should instead - be updated with the Update order item API. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Creates an order item. Existing order item cannot be updated with this api and should instead - be updated with the Update order item API. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_resource: Order item details from request body. Is either a OrderItemResource - type or a IO type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_order_item_initial( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - order_item_resource=order_item_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements - self, order_item_name: str, resource_group_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_order_item_by_name_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_order_item_by_name_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_order_item_by_name_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @distributed_trace - def begin_delete_order_item_by_name( - self, order_item_name: 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_order_item_by_name_initial( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete_order_item_by_name.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - def _update_order_item_initial( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_update_parameter, (IO, bytes)): - _content = order_item_update_parameter - else: - _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") - - request = build_update_order_item_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_order_item_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - def begin_update_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: _models.OrderItemUpdateParameter, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: IO, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. Required. - :type order_item_update_parameter: IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_order_item( - self, - order_item_name: str, - resource_group_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Updates the properties of an existing order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_update_parameter: order item update parameters from request body. Is either a - OrderItemUpdateParameter type or a IO type. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2020_12_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - def cancel_order_item( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: _models.CancellationReason, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Cancel order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel_order_item( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Cancel order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel_order_item( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **kwargs: Any - ) -> None: - """Cancel order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.CancellationReason - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cancellation_reason, (IO, bytes)): - _content = cancellation_reason - else: - _json = self._serialize.body(cancellation_reason, "CancellationReason") - - request = build_cancel_order_item_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.cancel_order_item.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" - } - - def _return_order_item_initial( # pylint: disable=inconsistent-return-statements - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(return_order_item_details, (IO, bytes)): - _content = return_order_item_details - else: - _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") - - request = build_return_order_item_request( - order_item_name=order_item_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._return_order_item_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _return_order_item_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } - - @overload - def begin_return_order_item( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: _models.ReturnOrderItemDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Return order item. - - :param order_item_name: The name of the order item. 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.v2020_12_01_preview.models.ReturnOrderItemDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_return_order_item( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Return order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. Required. - :type return_order_item_details: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_return_order_item( - self, - order_item_name: str, - resource_group_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> LROPoller[None]: - """Return order item. - - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param return_order_item_details: Return order item CurrentStatus. Is either a - ReturnOrderItemDetails type or a IO type. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2020_12_01_preview.models.ReturnOrderItemDetails or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-12-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-12-01-preview") - ) - 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( # type: ignore - 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 - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_return_order_item.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/py.typed b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/__init__.py deleted file mode 100644 index cf345f5e5ed1..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._edge_order_management_client import EdgeOrderManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EdgeOrderManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_configuration.py deleted file mode 100644 index 9842256d512b..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_configuration.py +++ /dev/null @@ -1,72 +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 sys -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for EdgeOrderManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-12-01". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", "2021-12-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_edge_order_management_client.py deleted file mode 100644 index 30dbd3ca5bbf..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_edge_order_management_client.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import EdgeOrderManagementClientConfiguration -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 - ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "EdgeOrderManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_metadata.json b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_metadata.json deleted file mode 100644 index afaa0d0192d4..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_metadata.json +++ /dev/null @@ -1,479 +0,0 @@ -{ - "chosen_version": "2021-12-01", - "total_api_version_list": ["2021-12-01"], - "client": { - "name": "EdgeOrderManagementClient", - "filename": "_edge_order_management_client", - "description": "The EdgeOrder Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"EdgeOrderManagementClientOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The ID of the target subscription. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The ID of the target subscription. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - }, - "operation_mixins": { - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Iterable\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"azurecore\": {\"azure.core.paging\": [\"ItemPaged\"], \"azure.core.polling\": [\"LROPoller\"]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"azurecore\": {\"azure.core.async_paging\": [\"AsyncItemPaged\"], \"azure.core.polling\": [\"AsyncLROPoller\"]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", - "operations": { - "list_operations" : { - "sync": { - "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e Iterable[\"_models.Operation\"]:\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Operation or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "**kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_operations(\n self,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.Operation\"]:\n", - "doc": "\"\"\"This method gets all the operations that are exposed for customer.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Operation or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Operation]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "**kwargs" - } - }, - "list_addresses_at_subscription_level" : { - "sync": { - "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "filter, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_addresses_at_subscription_level(\n self,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the subscription.\n\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of addresses. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "filter, skip_token, **kwargs" - } - }, - "list_product_families" : { - "sync": { - "signature": "def list_product_families(\n self,\n product_families_request: Union[_models.ProductFamiliesRequest, IO],\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ProductFamily\"]:\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families. Is either a\n ProductFamiliesRequest type or a IO type. Required.\n:type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest\n or IO\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product. Default value is None.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamily or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "product_families_request, expand, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_product_families(\n self,\n product_families_request: Union[_models.ProductFamiliesRequest, IO],\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ProductFamily\"]:\n", - "doc": "\"\"\"This method provides the list of product families for the given subscription.\n\n:param product_families_request: Filters for showing the product families. Is either a\n ProductFamiliesRequest type or a IO type. Required.\n:type product_families_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesRequest\n or IO\n:param expand: $expand is supported on configurations parameter for product, which provides\n details on the configurations for the product. Default value is None.\n:type expand: str\n:param skip_token: $skipToken is supported on list of product families, which provides the next\n page in the list of product families. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamily or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamily]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "product_families_request, expand, skip_token, **kwargs" - } - }, - "list_configurations" : { - "sync": { - "signature": "def list_configurations(\n self,\n configurations_request: Union[_models.ConfigurationsRequest, IO],\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.Configuration\"]:\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations. Is either a\n ConfigurationsRequest type or a IO type. Required.\n:type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or\n IO\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configuration or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "configurations_request, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_configurations(\n self,\n configurations_request: Union[_models.ConfigurationsRequest, IO],\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.Configuration\"]:\n", - "doc": "\"\"\"This method provides the list of configurations for the given product family, product line and\nproduct under subscription.\n\n:param configurations_request: Filters for showing the configurations. Is either a\n ConfigurationsRequest type or a IO type. Required.\n:type configurations_request: ~azure.mgmt.edgeorder.v2021_12_01.models.ConfigurationsRequest or\n IO\n:param skip_token: $skipToken is supported on list of configurations, which provides the next\n page in the list of configurations. Default value is None.\n:type skip_token: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either Configuration or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.Configuration]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "configurations_request, skip_token, **kwargs" - } - }, - "list_product_families_metadata" : { - "sync": { - "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.ProductFamiliesMetadataDetails\"]:\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of\n cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_product_families_metadata(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.ProductFamiliesMetadataDetails\"]:\n", - "doc": "\"\"\"This method provides the list of product families metadata for the given subscription.\n\n:param skip_token: $skipToken is supported on list of product families metadata, which provides\n the next page in the list of product families metadata. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of\n cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.ProductFamiliesMetadataDetails]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "skip_token, **kwargs" - } - }, - "list_order_at_subscription_level" : { - "sync": { - "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderResource\"]:\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_order_at_subscription_level(\n self,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderResource\"]:\n", - "doc": "\"\"\"Lists order at subscription level.\n\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "skip_token, **kwargs" - } - }, - "list_order_items_at_subscription_level" : { - "sync": { - "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "filter, expand, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_order_items_at_subscription_level(\n self,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Lists order item at subscription level.\n\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "filter, expand, skip_token, **kwargs" - } - }, - "list_addresses_at_resource_group_level" : { - "sync": { - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, filter, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_addresses_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.AddressResource\"]:\n", - "doc": "\"\"\"Lists all the addresses available under the given resource group.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on shipping address properties. Filter\n supports only equals operation. Default value is None.\n:type filter: str\n:param skip_token: $skipToken is supported on Get list of addresses, which provides the next\n page in the list of address. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either AddressResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, filter, skip_token, **kwargs" - } - }, - "get_address_by_name" : { - "sync": { - "signature": "def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e _models.AddressResource:\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def get_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e _models.AddressResource:\n", - "doc": "\"\"\"Gets information about the specified address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - } - }, - "_create_address_initial" : { - "sync": { - "signature": "def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_resource, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _create_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_resource, **kwargs" - } - }, - "begin_create_address" : { - "sync": { - "signature": "def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e LROPoller[_models.AddressResource]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_resource, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_create_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_resource: Union[_models.AddressResource, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.AddressResource]:\n", - "doc": "\"\"\"Creates a new address with the specified parameters. Existing address can be updated with this\nAPI.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_resource: Address details from request body. Is either a AddressResource type or\n a IO type. Required.\n:type address_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_resource, **kwargs" - } - }, - "_delete_address_by_name_initial" : { - "sync": { - "signature": "def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _delete_address_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - } - }, - "begin_delete_address_by_name" : { - "sync": { - "signature": "def begin_delete_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_delete_address_by_name(\n self,\n address_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, **kwargs" - } - }, - "_update_address_initial" : { - "sync": { - "signature": "def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _update_address_initial(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.AddressResource]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AddressResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" - } - }, - "begin_update_address" : { - "sync": { - "signature": "def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[_models.AddressResource]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_update_address(\n self,\n address_name: str,\n resource_group_name: str,\n address_update_parameter: Union[_models.AddressUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.AddressResource]:\n", - "doc": "\"\"\"Updates the properties of an existing address.\n\n:param address_name: The name of the address Resource within the specified resource group.\n address names must be between 3 and 24 characters in length and use any alphanumeric and\n underscore only. Required.\n:type address_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param address_update_parameter: Address update parameters from request body. Is either a\n AddressUpdateParameter type or a IO type. Required.\n:type address_update_parameter: ~azure.mgmt.edgeorder.v2021_12_01.models.AddressUpdateParameter\n or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the job on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either AddressResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.AddressResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "address_name, resource_group_name, address_update_parameter, if_match, **kwargs" - } - }, - "list_order_at_resource_group_level" : { - "sync": { - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderResource\"]:\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_order_at_resource_group_level(\n self,\n resource_group_name: str,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderResource\"]:\n", - "doc": "\"\"\"Lists order at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param skip_token: $skipToken is supported on Get list of order, which provides the next page\n in the list of order. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, skip_token, **kwargs" - } - }, - "get_order_by_name" : { - "sync": { - "signature": "def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e _models.OrderResource:\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order. Required.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param location: The name of Azure region. Required.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_name, resource_group_name, location, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def get_order_by_name(\n self,\n order_name: str,\n resource_group_name: str,\n location: str,\n **kwargs: Any\n) -\u003e _models.OrderResource:\n", - "doc": "\"\"\"Gets an order.\n\n:param order_name: The name of the order. Required.\n:type order_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param location: The name of Azure region. Required.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_name, resource_group_name, location, **kwargs" - } - }, - "list_order_items_at_resource_group_level" : { - "sync": { - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e Iterable[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, filter, expand, skip_token, **kwargs" - }, - "async": { - "coroutine": false, - "signature": "def list_order_items_at_resource_group_level(\n self,\n resource_group_name: str,\n filter: Optional[str] = None,\n expand: Optional[str] = None,\n skip_token: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncIterable[\"_models.OrderItemResource\"]:\n", - "doc": "\"\"\"Lists order item at resource group level.\n\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param filter: $filter is supported to filter based on order id. Filter supports only equals\n operation. Default value is None.\n:type filter: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:param skip_token: $skipToken is supported on Get list of order items, which provides the next\n page in the list of order items. Default value is None.\n:type skip_token: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either OrderItemResource or the result of cls(response)\n:rtype:\n ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "resource_group_name, filter, expand, skip_token, **kwargs" - } - }, - "get_order_item_by_name" : { - "sync": { - "signature": "def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e _models.OrderItemResource:\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, expand, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def get_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n expand: Optional[str] = None,\n **kwargs: Any\n) -\u003e _models.OrderItemResource:\n", - "doc": "\"\"\"Gets an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param expand: $expand is supported on device details, forward shipping details and reverse\n shipping details parameters. Each of these can be provided as a comma separated list. Device\n Details for order item provides details on the devices of the product, Forward and Reverse\n Shipping details provide forward and reverse shipping details respectively. Default value is\n None.\n:type expand: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, expand, **kwargs" - } - }, - "_create_order_item_initial" : { - "sync": { - "signature": "def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _create_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" - } - }, - "begin_create_order_item" : { - "sync": { - "signature": "def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e LROPoller[_models.OrderItemResource]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_create_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_resource: Union[_models.OrderItemResource, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.OrderItemResource]:\n", - "doc": "\"\"\"Creates an order item. Existing order item cannot be updated with this api and should instead\nbe updated with the Update order item API.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_resource: Order item details from request body. Is either a OrderItemResource\n type or a IO type. Required.\n:type order_item_resource: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_resource, **kwargs" - } - }, - "_delete_order_item_by_name_initial" : { - "sync": { - "signature": "def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _delete_order_item_by_name_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, **kwargs" - } - }, - "begin_delete_order_item_by_name" : { - "sync": { - "signature": "def begin_delete_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_delete_order_item_by_name(\n self,\n order_item_name: str,\n resource_group_name: str,\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Deletes an order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, **kwargs" - } - }, - "_update_order_item_initial" : { - "sync": { - "signature": "def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _update_order_item_initial(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e Optional[_models.OrderItemResource]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OrderItemResource or None or the result of cls(response)\n:rtype: ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource or None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" - } - }, - "begin_update_order_item" : { - "sync": { - "signature": "def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e LROPoller[_models.OrderItemResource]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_update_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO],\n if_match: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncLROPoller[_models.OrderItemResource]:\n", - "doc": "\"\"\"Updates the properties of an existing order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param order_item_update_parameter: order item update parameters from request body. Is either a\n OrderItemUpdateParameter type or a IO type. Required.\n:type order_item_update_parameter:\n ~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemUpdateParameter or IO\n:param if_match: Defines the If-Match condition. The patch will be performed only if the ETag\n of the order on the server matches this value. Default value is None.\n:type if_match: str\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of\n cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2021_12_01.models.OrderItemResource]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, order_item_update_parameter, if_match, **kwargs" - } - }, - "cancel_order_item" : { - "sync": { - "signature": "def cancel_order_item( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: Union[_models.CancellationReason, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a\n IO type. Required.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, cancellation_reason, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def cancel_order_item( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n cancellation_reason: Union[_models.CancellationReason, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Cancel order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a\n IO type. Required.\n:type cancellation_reason: ~azure.mgmt.edgeorder.v2021_12_01.models.CancellationReason or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, cancellation_reason, **kwargs" - } - }, - "_return_order_item_initial" : { - "sync": { - "signature": "def _return_order_item_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def _return_order_item_initial( # pylint: disable=inconsistent-return-statements\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e None:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None or the result of cls(response)\n:rtype: None\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" - } - }, - "begin_return_order_item" : { - "sync": { - "signature": "def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e LROPoller[None]:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" - }, - "async": { - "coroutine": true, - "signature": "async def begin_return_order_item(\n self,\n order_item_name: str,\n resource_group_name: str,\n return_order_item_details: Union[_models.ReturnOrderItemDetails, IO],\n **kwargs: Any\n) -\u003e AsyncLROPoller[None]:\n", - "doc": "\"\"\"Return order item.\n\n:param order_item_name: The name of the order item. Required.\n:type order_item_name: str\n:param resource_group_name: The name of the resource group. The name is case insensitive.\n Required.\n:type resource_group_name: str\n:param return_order_item_details: Return order item CurrentStatus. Is either a\n ReturnOrderItemDetails type or a IO type. Required.\n:type return_order_item_details:\n ~azure.mgmt.edgeorder.v2021_12_01.models.ReturnOrderItemDetails or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", - "call": "order_item_name, resource_group_name, return_order_item_details, **kwargs" - } - } - } - } -} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_vendor.py deleted file mode 100644 index 7f8e08518951..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_vendor.py +++ /dev/null @@ -1,48 +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 List, TYPE_CHECKING, cast - -from azure.core.pipeline.transport import HttpRequest - -from ._configuration import EdgeOrderManagementClientConfiguration - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core import PipelineClient - - from .._serialization import Deserializer, Serializer - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - -class EdgeOrderManagementClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "PipelineClient" - _config: EdgeOrderManagementClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_version.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_version.py deleted file mode 100644 index e32dc6ec4218..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0b1" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/__init__.py deleted file mode 100644 index b9eec9b0ea44..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._edge_order_management_client import EdgeOrderManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EdgeOrderManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_configuration.py deleted file mode 100644 index cfdb96f35136..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_configuration.py +++ /dev/null @@ -1,72 +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 sys -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for EdgeOrderManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-12-01". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2021-12-01"] = kwargs.pop("api_version", "2021-12-01") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_edge_order_management_client.py deleted file mode 100644 index 9275fbfdaacd..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_edge_order_management_client.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING - -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import 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 - ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "EdgeOrderManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/__init__.py deleted file mode 100644 index 9e856f64458f..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/__init__.py +++ /dev/null @@ -1,19 +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 ._edge_order_management_client_operations import EdgeOrderManagementClientOperationsMixin - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EdgeOrderManagementClientOperationsMixin", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/__init__.py deleted file mode 100644 index 9e856f64458f..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/__init__.py +++ /dev/null @@ -1,19 +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 ._edge_order_management_client_operations import EdgeOrderManagementClientOperationsMixin - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EdgeOrderManagementClientOperationsMixin", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/py.typed b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2021_12_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/__init__.py deleted file mode 100644 index cf345f5e5ed1..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._edge_order_management_client import EdgeOrderManagementClient -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EdgeOrderManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_configuration.py deleted file mode 100644 index fb966bb503c3..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_configuration.py +++ /dev/null @@ -1,72 +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 sys -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for EdgeOrderManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-05-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-05-01-preview"] = kwargs.pop("api_version", "2022-05-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_edge_order_management_client.py deleted file mode 100644 index 0eb6f9ac818c..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_edge_order_management_client.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, TYPE_CHECKING - -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import EdgeOrderManagementClientConfiguration -from .operations import ( - AddressesOperations, - Operations, - OrderItemsOperations, - OrdersOperations, - ProductsAndConfigurationsOperations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials import TokenCredential - - -class EdgeOrderManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The EdgeOrder Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.edgeorder.v2022_05_01_preview.operations.Operations - :ivar addresses: AddressesOperations operations - :vartype addresses: azure.mgmt.edgeorder.v2022_05_01_preview.operations.AddressesOperations - :ivar products_and_configurations: ProductsAndConfigurationsOperations operations - :vartype products_and_configurations: - azure.mgmt.edgeorder.v2022_05_01_preview.operations.ProductsAndConfigurationsOperations - :ivar order_items: OrderItemsOperations operations - :vartype order_items: azure.mgmt.edgeorder.v2022_05_01_preview.operations.OrderItemsOperations - :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.edgeorder.v2022_05_01_preview.operations.OrdersOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-05-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = EdgeOrderManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.addresses = AddressesOperations(self._client, self._config, self._serialize, self._deserialize) - self.products_and_configurations = ProductsAndConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.order_items = OrderItemsOperations(self._client, self._config, self._serialize, self._deserialize) - self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> "EdgeOrderManagementClient": - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_metadata.json b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_metadata.json deleted file mode 100644 index 3e153268a377..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_metadata.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "chosen_version": "2022-05-01-preview", - "total_api_version_list": ["2022-05-01-preview"], - "client": { - "name": "EdgeOrderManagementClient", - "filename": "_edge_order_management_client", - "description": "The EdgeOrder Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"EdgeOrderManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The ID of the target subscription. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The ID of the target subscription. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "addresses": "AddressesOperations", - "products_and_configurations": "ProductsAndConfigurationsOperations", - "order_items": "OrderItemsOperations", - "orders": "OrdersOperations" - } -} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_vendor.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_vendor.py deleted file mode 100644 index bd0df84f5319..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_vendor.py +++ /dev/null @@ -1,30 +0,0 @@ -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import List, cast - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_version.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_version.py deleted file mode 100644 index e32dc6ec4218..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "2.0.0b1" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/__init__.py deleted file mode 100644 index b9eec9b0ea44..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._edge_order_management_client import EdgeOrderManagementClient - -try: - from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "EdgeOrderManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) - -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_configuration.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_configuration.py deleted file mode 100644 index e0a9854f2545..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_configuration.py +++ /dev/null @@ -1,72 +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 sys -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class EdgeOrderManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for EdgeOrderManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-05-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - super(EdgeOrderManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-05-01-preview"] = kwargs.pop("api_version", "2022-05-01-preview") - - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = api_version - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "mgmt-edgeorder/{}".format(VERSION)) - self._configure(**kwargs) - - def _configure(self, **kwargs: Any) -> None: - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get("authentication_policy") - if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( - self.credential, *self.credential_scopes, **kwargs - ) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_edge_order_management_client.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_edge_order_management_client.py deleted file mode 100644 index ff9e58a74d43..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/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 azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import EdgeOrderManagementClientConfiguration -from .operations import ( - AddressesOperations, - Operations, - OrderItemsOperations, - OrdersOperations, - ProductsAndConfigurationsOperations, -) - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class EdgeOrderManagementClient: # pylint: disable=client-accepts-api-version-keyword - """The EdgeOrder Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.Operations - :ivar addresses: AddressesOperations operations - :vartype addresses: azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.AddressesOperations - :ivar products_and_configurations: ProductsAndConfigurationsOperations operations - :vartype products_and_configurations: - azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.ProductsAndConfigurationsOperations - :ivar order_items: OrderItemsOperations operations - :vartype order_items: - azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.OrderItemsOperations - :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.edgeorder.v2022_05_01_preview.aio.operations.OrdersOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-05-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any - ) -> None: - self._config = EdgeOrderManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs - ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.addresses = AddressesOperations(self._client, self._config, self._serialize, self._deserialize) - self.products_and_configurations = ProductsAndConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.order_items = OrderItemsOperations(self._client, self._config, self._serialize, self._deserialize) - self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, **kwargs) - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "EdgeOrderManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/__init__.py deleted file mode 100644 index c3b25bc71af1..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._addresses_operations import AddressesOperations -from ._products_and_configurations_operations import ProductsAndConfigurationsOperations -from ._order_items_operations import OrderItemsOperations -from ._orders_operations import OrdersOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "AddressesOperations", - "ProductsAndConfigurationsOperations", - "OrderItemsOperations", - "OrdersOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_addresses_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_addresses_operations.py deleted file mode 100644 index 37f0c642648e..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_addresses_operations.py +++ /dev/null @@ -1,951 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._addresses_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AddressesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s - :attr:`addresses` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription( - self, filter: Optional[str] = None, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.AddressResource"]: - """List all the addresses available under the subscription. - - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. Default value is None. - :type filter: str - :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses"} - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.AddressResource"]: - """List all the addresses available under the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. Default value is None. - :type filter: str - :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" - } - - @distributed_trace_async - async def get(self, resource_group_name: str, address_name: str, **kwargs: Any) -> _models.AddressResource: - """Get information about the specified address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - address_name=address_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - async def _create_initial( - self, - resource_group_name: str, - address_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_resource, (IO, bytes)): - _content = address_resource - else: - _json = self._serialize.body(address_resource, "AddressResource") - - request = build_create_request( - resource_group_name=resource_group_name, - address_name=address_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - address_name: str, - address_resource: _models.AddressResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Create a new address with the specified parameters. Existing address cannot be updated with - this API and should - instead be updated with the Update address API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_resource: Address details from request body. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - address_name: str, - address_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Create a new address with the specified parameters. Existing address cannot be updated with - this API and should - instead be updated with the Update address API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_resource: Address details from request body. Required. - :type address_resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - address_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Create a new address with the specified parameters. Existing address cannot be updated with - this API and should - instead be updated with the Update address API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_resource: Address details from request body. Is either a AddressResource type or - a IO type. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - address_name=address_name, - address_resource=address_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, address_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - address_name=address_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, address_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete an address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - address_name=address_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - async def _update_initial( - self, - resource_group_name: str, - address_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_update_parameter, (IO, bytes)): - _content = address_update_parameter - else: - _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") - - request = build_update_request( - resource_group_name=resource_group_name, - address_name=address_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - address_name: str, - address_update_parameter: _models.AddressUpdateParameter, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Update the properties of an existing address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - address_name: str, - address_update_parameter: IO, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Update the properties of an existing address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - address_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.AddressResource]: - """Update the properties of an existing address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_update_parameter: Address update parameters from request body. Is either a - AddressUpdateParameter type or a IO type. Required. - :type address_update_parameter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - address_name=address_name, - address_update_parameter=address_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_operations.py deleted file mode 100644 index 26d739c9c702..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,140 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operations import build_list_request - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s - :attr:`operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """List all the supported operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_order_items_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_order_items_operations.py deleted file mode 100644 index edbd8fcb11fb..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_order_items_operations.py +++ /dev/null @@ -1,1329 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._order_items_operations import ( - build_cancel_request, - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_return_method_request, - build_update_request, -) - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class OrderItemsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s - :attr:`order_items` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription( - self, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResource"]: - """List order items at subscription level. - - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. Default value is None. - :type filter: str - :param expand: $expand is supported on parent device details, device details, forward shipping - details and reverse shipping details parameters. Each of these can be provided as a comma - separated list. Parent Device Details for order item provides details on the devices of the - product, Device Details for order item provides details on the devices of the child - configurations of the product, Forward and Reverse Shipping details provide forward and reverse - shipping details respectively. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - filter=filter, - expand=expand, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems"} - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.OrderItemResource"]: - """List order items at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. Default value is None. - :type filter: str - :param expand: $expand is supported on parent device details, device details, forward shipping - details and reverse shipping details parameters. Each of these can be provided as a comma - separated list. Parent Device Details for order item provides details on the devices of the - product, Device Details for order item provides details on the devices of the child - configurations of the product, Forward and Reverse Shipping details provide forward and reverse - shipping details respectively. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - filter=filter, - expand=expand, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" - } - - @distributed_trace_async - async def get( - self, resource_group_name: str, order_item_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.OrderItemResource: - """Get an order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param expand: $expand is supported on parent device details, device details, forward shipping - details and reverse shipping details parameters. Each of these can be provided as a comma - separated list. Parent Device Details for order item provides details on the devices of the - product, Device Details for order item provides details on the devices of the child - configurations of the product, Forward and Reverse Shipping details provide forward and reverse - shipping details respectively. Default value is None. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - async def _create_initial( - self, - resource_group_name: str, - order_item_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_resource, (IO, bytes)): - _content = order_item_resource - else: - _json = self._serialize.body(order_item_resource, "OrderItemResource") - - request = build_create_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - async def begin_create( - self, - resource_group_name: str, - order_item_name: str, - order_item_resource: _models.OrderItemResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Create an order item. Existing order item cannot be updated with this api and should instead be - updated with the Update order item - API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - order_item_name: str, - order_item_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Create an order item. Existing order item cannot be updated with this api and should instead be - updated with the Update order item - API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - order_item_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Create an order item. Existing order item cannot be updated with this api and should instead be - updated with the Update order item - API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_resource: Order item details from request body. Is either a OrderItemResource - type or a IO type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - order_item_resource=order_item_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, order_item_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, order_item_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete an order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - order_item_name=order_item_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - async def _update_initial( - self, - resource_group_name: str, - order_item_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_update_parameter, (IO, bytes)): - _content = order_item_update_parameter - else: - _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") - - request = build_update_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - async def begin_update( - self, - resource_group_name: str, - order_item_name: str, - order_item_update_parameter: _models.OrderItemUpdateParameter, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Update the properties of an existing order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_update_parameter: Order item update parameters from request body. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - order_item_name: str, - order_item_update_parameter: IO, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Update the properties of an existing order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_update_parameter: Order item update parameters from request body. Required. - :type order_item_update_parameter: IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - order_item_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.OrderItemResource]: - """Update the properties of an existing order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_update_parameter: Order item update parameters from request body. Is either a - OrderItemUpdateParameter type or a IO type. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - order_item_update_parameter=order_item_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - order_item_name: str, - cancellation_reason: _models.CancellationReason, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Cancel order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - order_item_name: str, - cancellation_reason: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Cancel order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - order_item_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **kwargs: Any - ) -> None: - """Cancel order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CancellationReason - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cancellation_reason, (IO, bytes)): - _content = cancellation_reason - else: - _json = self._serialize.body(cancellation_reason, "CancellationReason") - - request = build_cancel_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" - } - - async def _return_method_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - order_item_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(return_order_item_details, (IO, bytes)): - _content = return_order_item_details - else: - _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") - - request = build_return_method_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._return_method_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _return_method_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } - - @overload - async def begin_return_method( - self, - resource_group_name: str, - order_item_name: str, - return_order_item_details: _models.ReturnOrderItemDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param return_order_item_details: Return order item details. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReturnOrderItemDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_return_method( - self, - resource_group_name: str, - order_item_name: str, - return_order_item_details: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param return_order_item_details: Return order item details. Required. - :type return_order_item_details: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_return_method( - self, - resource_group_name: str, - order_item_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Return order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param return_order_item_details: Return order item details. Is either a ReturnOrderItemDetails - type or a IO type. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReturnOrderItemDetails or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._return_method_initial( # type: ignore - resource_group_name=resource_group_name, - order_item_name=order_item_name, - return_order_item_details=return_order_item_details, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_return_method.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_orders_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_orders_operations.py deleted file mode 100644 index e05f7359e933..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_orders_operations.py +++ /dev/null @@ -1,324 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._orders_operations import ( - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, -) - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class OrdersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s - :attr:`orders` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription( - self, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.OrderResource"]: - """List orders at subscription level. - - :param skip_token: $skipToken is supported on Get list of orders, which provides the next page - in the list of orders. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders"} - - @distributed_trace_async - async def get( - self, resource_group_name: str, location: str, order_name: str, **kwargs: Any - ) -> _models.OrderResource: - """Get an order. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param location: The name of Azure region. Required. - :type location: str - :param order_name: The name of the order. Required. - :type order_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - location=location, - order_name=order_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OrderResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.OrderResource"]: - """List orders at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param skip_token: $skipToken is supported on Get list of orders, which provides the next page - in the list of orders. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_products_and_configurations_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_products_and_configurations_operations.py deleted file mode 100644 index 8725ecb54353..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/aio/operations/_products_and_configurations_operations.py +++ /dev/null @@ -1,500 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._products_and_configurations_operations import ( - build_list_configurations_request, - build_list_product_families_metadata_request, - build_list_product_families_request, -) - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ProductsAndConfigurationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.aio.EdgeOrderManagementClient`'s - :attr:`products_and_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def list_configurations( - self, - configurations_request: _models.ConfigurationsRequest, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.Configuration"]: - """List configurations for the given product family, product line and product for the given - subscription. - - :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationsRequest - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_configurations( - self, - configurations_request: IO, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.Configuration"]: - """List configurations for the given product family, product line and product for the given - subscription. - - :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_configurations( - self, - configurations_request: Union[_models.ConfigurationsRequest, IO], - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.Configuration"]: - """List configurations for the given product family, product line and product for the given - subscription. - - :param configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO type. Required. - :type configurations_request: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationsRequest or IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(configurations_request, (IO, bytes)): - _content = configurations_request - else: - _json = self._serialize.body(configurations_request, "ConfigurationsRequest") - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_configurations_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_configurations.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("Configurations", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_configurations.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" - } - - @overload - def list_product_families( - self, - product_families_request: _models.ProductFamiliesRequest, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamily"]: - """List product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesRequest - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_product_families( - self, - product_families_request: IO, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamily"]: - """List product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_product_families( - self, - product_families_request: Union[_models.ProductFamiliesRequest, IO], - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.ProductFamily"]: - """List product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Is either a - ProductFamiliesRequest type or a IO type. Required. - :type product_families_request: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesRequest or IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(product_families_request, (IO, bytes)): - _content = product_families_request - else: - _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_product_families_request( - subscription_id=self._config.subscription_id, - expand=expand, - skip_token=skip_token, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_product_families.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ProductFamilies", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_product_families.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" - } - - @distributed_trace - def list_product_families_metadata( - self, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.ProductFamiliesMetadataDetails"]: - """List product families metadata for the given subscription. - - :param skip_token: $skipToken is supported on list of product families metadata, which provides - the next page in the list of product families metadata. Default value is None. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesMetadataDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_product_families_metadata_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_product_families_metadata.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - list_product_families_metadata.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/__init__.py deleted file mode 100644 index a53a21a96a65..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/__init__.py +++ /dev/null @@ -1,227 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._models_py3 import AdditionalConfiguration -from ._models_py3 import AddressDetails -from ._models_py3 import AddressProperties -from ._models_py3 import AddressResource -from ._models_py3 import AddressResourceList -from ._models_py3 import AddressUpdateParameter -from ._models_py3 import AvailabilityInformation -from ._models_py3 import BasicInformation -from ._models_py3 import BillingMeterDetails -from ._models_py3 import CancellationReason -from ._models_py3 import CategoryInformation -from ._models_py3 import ChildConfiguration -from ._models_py3 import ChildConfigurationFilter -from ._models_py3 import CommonProperties -from ._models_py3 import Configuration -from ._models_py3 import ConfigurationDeviceDetails -from ._models_py3 import ConfigurationFilter -from ._models_py3 import ConfigurationProperties -from ._models_py3 import Configurations -from ._models_py3 import ConfigurationsRequest -from ._models_py3 import ContactDetails -from ._models_py3 import CostInformation -from ._models_py3 import CustomerSubscriptionDetails -from ._models_py3 import CustomerSubscriptionRegisteredFeatures -from ._models_py3 import Description -from ._models_py3 import DeviceDetails -from ._models_py3 import Dimensions -from ._models_py3 import DisplayInfo -from ._models_py3 import EncryptionPreferences -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import FilterableProperty -from ._models_py3 import ForwardShippingDetails -from ._models_py3 import GroupedChildConfigurations -from ._models_py3 import HierarchyInformation -from ._models_py3 import ImageInformation -from ._models_py3 import Link -from ._models_py3 import ManagementResourcePreferences -from ._models_py3 import MeterDetails -from ._models_py3 import NotificationPreference -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import OrderItemDetails -from ._models_py3 import OrderItemResource -from ._models_py3 import OrderItemResourceList -from ._models_py3 import OrderItemUpdateParameter -from ._models_py3 import OrderResource -from ._models_py3 import OrderResourceList -from ._models_py3 import Pav2MeterDetails -from ._models_py3 import Preferences -from ._models_py3 import Product -from ._models_py3 import ProductDetails -from ._models_py3 import ProductFamilies -from ._models_py3 import ProductFamiliesMetadata -from ._models_py3 import ProductFamiliesMetadataDetails -from ._models_py3 import ProductFamiliesRequest -from ._models_py3 import ProductFamily -from ._models_py3 import ProductFamilyProperties -from ._models_py3 import ProductLine -from ._models_py3 import ProductLineProperties -from ._models_py3 import ProductProperties -from ._models_py3 import ProxyResource -from ._models_py3 import PurchaseMeterDetails -from ._models_py3 import Resource -from ._models_py3 import ResourceMoveRequest -from ._models_py3 import ResourceProviderDetails -from ._models_py3 import ReturnOrderItemDetails -from ._models_py3 import ReverseShippingDetails -from ._models_py3 import ShippingAddress -from ._models_py3 import Specification -from ._models_py3 import StageDetails -from ._models_py3 import SystemData -from ._models_py3 import TrackedResource -from ._models_py3 import TransportPreferences - -from ._edge_order_management_client_enums import ActionStatusEnum -from ._edge_order_management_client_enums import ActionType -from ._edge_order_management_client_enums import AddressType -from ._edge_order_management_client_enums import AddressValidationStatus -from ._edge_order_management_client_enums import AvailabilityStage -from ._edge_order_management_client_enums import BillingType -from ._edge_order_management_client_enums import ChargingType -from ._edge_order_management_client_enums import ChildConfigurationType -from ._edge_order_management_client_enums import CreatedByType -from ._edge_order_management_client_enums import DescriptionType -from ._edge_order_management_client_enums import DisabledReason -from ._edge_order_management_client_enums import DoubleEncryptionStatus -from ._edge_order_management_client_enums import FulfillmentType -from ._edge_order_management_client_enums import IdentificationType -from ._edge_order_management_client_enums import ImageType -from ._edge_order_management_client_enums import LengthHeightUnit -from ._edge_order_management_client_enums import LinkType -from ._edge_order_management_client_enums import MeteringType -from ._edge_order_management_client_enums import NotificationStageName -from ._edge_order_management_client_enums import OrderItemCancellationEnum -from ._edge_order_management_client_enums import OrderItemReturnEnum -from ._edge_order_management_client_enums import OrderItemType -from ._edge_order_management_client_enums import OrderMode -from ._edge_order_management_client_enums import Origin -from ._edge_order_management_client_enums import StageName -from ._edge_order_management_client_enums import StageStatus -from ._edge_order_management_client_enums import SupportedFilterTypes -from ._edge_order_management_client_enums import TransportShipmentTypes -from ._edge_order_management_client_enums import WeightMeasurementUnit -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AdditionalConfiguration", - "AddressDetails", - "AddressProperties", - "AddressResource", - "AddressResourceList", - "AddressUpdateParameter", - "AvailabilityInformation", - "BasicInformation", - "BillingMeterDetails", - "CancellationReason", - "CategoryInformation", - "ChildConfiguration", - "ChildConfigurationFilter", - "CommonProperties", - "Configuration", - "ConfigurationDeviceDetails", - "ConfigurationFilter", - "ConfigurationProperties", - "Configurations", - "ConfigurationsRequest", - "ContactDetails", - "CostInformation", - "CustomerSubscriptionDetails", - "CustomerSubscriptionRegisteredFeatures", - "Description", - "DeviceDetails", - "Dimensions", - "DisplayInfo", - "EncryptionPreferences", - "ErrorAdditionalInfo", - "ErrorDetail", - "ErrorResponse", - "FilterableProperty", - "ForwardShippingDetails", - "GroupedChildConfigurations", - "HierarchyInformation", - "ImageInformation", - "Link", - "ManagementResourcePreferences", - "MeterDetails", - "NotificationPreference", - "Operation", - "OperationDisplay", - "OperationListResult", - "OrderItemDetails", - "OrderItemResource", - "OrderItemResourceList", - "OrderItemUpdateParameter", - "OrderResource", - "OrderResourceList", - "Pav2MeterDetails", - "Preferences", - "Product", - "ProductDetails", - "ProductFamilies", - "ProductFamiliesMetadata", - "ProductFamiliesMetadataDetails", - "ProductFamiliesRequest", - "ProductFamily", - "ProductFamilyProperties", - "ProductLine", - "ProductLineProperties", - "ProductProperties", - "ProxyResource", - "PurchaseMeterDetails", - "Resource", - "ResourceMoveRequest", - "ResourceProviderDetails", - "ReturnOrderItemDetails", - "ReverseShippingDetails", - "ShippingAddress", - "Specification", - "StageDetails", - "SystemData", - "TrackedResource", - "TransportPreferences", - "ActionStatusEnum", - "ActionType", - "AddressType", - "AddressValidationStatus", - "AvailabilityStage", - "BillingType", - "ChargingType", - "ChildConfigurationType", - "CreatedByType", - "DescriptionType", - "DisabledReason", - "DoubleEncryptionStatus", - "FulfillmentType", - "IdentificationType", - "ImageType", - "LengthHeightUnit", - "LinkType", - "MeteringType", - "NotificationStageName", - "OrderItemCancellationEnum", - "OrderItemReturnEnum", - "OrderItemType", - "OrderMode", - "Origin", - "StageName", - "StageStatus", - "SupportedFilterTypes", - "TransportShipmentTypes", - "WeightMeasurementUnit", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_edge_order_management_client_enums.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_edge_order_management_client_enums.py deleted file mode 100644 index 4b162e190900..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_edge_order_management_client_enums.py +++ /dev/null @@ -1,343 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class ActionStatusEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Describes whether the order item is deletable or not.""" - - ALLOWED = "Allowed" - """Allowed flag.""" - NOT_ALLOWED = "NotAllowed" - """Not Allowed flag.""" - - -class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" - - INTERNAL = "Internal" - - -class AddressType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of address.""" - - NONE = "None" - """Address type not known.""" - RESIDENTIAL = "Residential" - """Residential Address.""" - COMMERCIAL = "Commercial" - """Commercial Address.""" - - -class AddressValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of address validation.""" - - VALID = "Valid" - """Address provided is valid.""" - INVALID = "Invalid" - """Address provided is invalid or not supported.""" - AMBIGUOUS = "Ambiguous" - """Address provided is ambiguous, please choose one of the alternate addresses returned.""" - - -class AvailabilityStage(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current availability stage of the product.""" - - AVAILABLE = "Available" - """Product is available.""" - PREVIEW = "Preview" - """Product is in preview.""" - SIGNUP = "Signup" - """Product is available only on signup.""" - DISCOVERABLE = "Discoverable" - """Product is not available in our service but can be discovered from other sources.""" - COMING_SOON = "ComingSoon" - """Product is coming soon.""" - UNAVAILABLE = "Unavailable" - """Product is not available.""" - DEPRECATED = "Deprecated" - """Product is deprecated.""" - - -class BillingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represents billing type.""" - - PAV2 = "Pav2" - """PaV2 billing.""" - PURCHASE = "Purchase" - """Purchase billing.""" - - -class ChargingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Charging type.""" - - PER_ORDER = "PerOrder" - """Per order charging type.""" - PER_DEVICE = "PerDevice" - """Per device charging type.""" - - -class ChildConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ChildConfigurationType.""" - - DEVICE_CONFIGURATION = "DeviceConfiguration" - """Child configuration is a device configuration.""" - ADDITIONAL_CONFIGURATION = "AdditionalConfiguration" - """Child configuration is an additional configuration.""" - - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - - -class DescriptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of description.""" - - BASE = "Base" - """Base description.""" - - -class DisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Reason why the product is disabled.""" - - NONE = "None" - """Not disabled.""" - COUNTRY = "Country" - """Not available in the requested country.""" - REGION = "Region" - """Not available to push data to the requested Azure region.""" - FEATURE = "Feature" - """Required features are not enabled.""" - OFFER_TYPE = "OfferType" - """Subscription does not have required offer types.""" - NO_SUBSCRIPTION_INFO = "NoSubscriptionInfo" - """Subscription has not registered to Microsoft.DataBox and Service does not have the subscription - #: notification.""" - NOT_AVAILABLE = "NotAvailable" - """The product is not yet available.""" - OUT_OF_STOCK = "OutOfStock" - """The product is out of stock.""" - - -class DoubleEncryptionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Double encryption status as entered by the customer. It is compulsory to give this parameter if - the 'Deny' or 'Disabled' policy is configured. - """ - - DISABLED = "Disabled" - """Double encryption is disabled.""" - ENABLED = "Enabled" - """Double encryption is enabled.""" - - -class FulfillmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The entity responsible for fulfillment of the item at the given hierarchy level.""" - - MICROSOFT = "Microsoft" - """The fulfillment (the whole journey of the product offering) is handled by microsoft.""" - EXTERNAL = "External" - """The fulfillment (the whole journey of the product offering) is handled by external third party - #: entities.""" - - -class IdentificationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Identification type of the configuration.""" - - NOT_SUPPORTED = "NotSupported" - """Product does not have any explicit identifier.""" - SERIAL_NUMBER = "SerialNumber" - """Product is identifiable by serial number.""" - - -class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the image.""" - - MAIN_IMAGE = "MainImage" - """Main image.""" - BULLET_IMAGE = "BulletImage" - """Bullet image.""" - GENERIC_IMAGE = "GenericImage" - """Generic image.""" - - -class LengthHeightUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Unit for the dimensions of length, height and width.""" - - IN = "IN" - """Inch, applicable for West US.""" - CM = "CM" - """Centimeter.""" - - -class LinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of link.""" - - GENERIC = "Generic" - """Generic link.""" - TERMS_AND_CONDITIONS = "TermsAndConditions" - """Terms and conditions link.""" - SPECIFICATION = "Specification" - """Link to product specification.""" - DOCUMENTATION = "Documentation" - """Link to product documentation.""" - KNOW_MORE = "KnowMore" - """Link to know more.""" - SIGN_UP = "SignUp" - """Link to sign up for products.""" - DISCOVERABLE = "Discoverable" - """Link to order the product from another source and not from Azure Edge Hardware Center.""" - - -class MeteringType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represents Metering type (eg one-time or recurrent).""" - - ONE_TIME = "OneTime" - """One time billing.""" - RECURRING = "Recurring" - """Recurring billing.""" - ADHOC = "Adhoc" - """Adhoc billing.""" - - -class NotificationStageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the stage.""" - - SHIPPED = "Shipped" - """Notification at order item shipped from microsoft datacenter.""" - DELIVERED = "Delivered" - """Notification at order item delivered to customer.""" - - -class OrderItemCancellationEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Describes whether the order item is cancellable or not.""" - - CANCELLABLE = "Cancellable" - """Order item can be cancelled without fee.""" - CANCELLABLE_WITH_FEE = "CancellableWithFee" - """Order item can be cancelled with fee.""" - NOT_CANCELLABLE = "NotCancellable" - """Order item not cancellable.""" - - -class OrderItemReturnEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Describes whether the order item is returnable or not.""" - - RETURNABLE = "Returnable" - """Order item can be returned without fee.""" - RETURNABLE_WITH_FEE = "ReturnableWithFee" - """Order item can be returned with fee.""" - NOT_RETURNABLE = "NotReturnable" - """Order item not returnable.""" - - -class OrderItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Order item type.""" - - PURCHASE = "Purchase" - """Purchase OrderItem.""" - RENTAL = "Rental" - """Rental OrderItem.""" - - -class OrderMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Defines the mode of the Order item.""" - - DEFAULT = "Default" - """Default Order mode.""" - DO_NOT_FULFILL = "DoNotFulfill" - """Mode in which the Order will not be fulfilled.""" - - -class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - - -class StageName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stage name.""" - - PLACED = "Placed" - """Currently in draft mode and can still be cancelled.""" - IN_REVIEW = "InReview" - """Order is currently in draft mode and can still be cancelled.""" - CONFIRMED = "Confirmed" - """Order is confirmed.""" - READY_TO_SHIP = "ReadyToShip" - """Order is ready to ship.""" - SHIPPED = "Shipped" - """Order is in transit to customer.""" - DELIVERED = "Delivered" - """Order is delivered to customer.""" - IN_USE = "InUse" - """Order is in use at customer site.""" - RETURN_INITIATED = "ReturnInitiated" - """Return has been initiated by customer.""" - RETURN_PICKED_UP = "ReturnPickedUp" - """Order is in transit from customer to Microsoft.""" - RETURNED_TO_MICROSOFT = "ReturnedToMicrosoft" - """Order has been received back to Microsoft.""" - RETURN_COMPLETED = "ReturnCompleted" - """Return has now completed.""" - CANCELLED = "Cancelled" - """Order has been cancelled.""" - - -class StageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Stage status.""" - - NONE = "None" - """No status available yet.""" - IN_PROGRESS = "InProgress" - """Stage is in progress.""" - SUCCEEDED = "Succeeded" - """Stage has succeeded.""" - FAILED = "Failed" - """Stage has failed.""" - CANCELLED = "Cancelled" - """Stage has been cancelled.""" - CANCELLING = "Cancelling" - """Stage is cancelling.""" - - -class SupportedFilterTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of product filter.""" - - SHIP_TO_COUNTRIES = "ShipToCountries" - """Ship to country.""" - DOUBLE_ENCRYPTION_STATUS = "DoubleEncryptionStatus" - """Double encryption status.""" - - -class TransportShipmentTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates Shipment Logistics type that the customer preferred.""" - - CUSTOMER_MANAGED = "CustomerManaged" - """Shipment Logistics is handled by the customer.""" - MICROSOFT_MANAGED = "MicrosoftManaged" - """Shipment Logistics is handled by Microsoft.""" - - -class WeightMeasurementUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Unit for the dimensions of weight.""" - - LBS = "LBS" - """Pounds.""" - KGS = "KGS" - """Kilograms.""" diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_models_py3.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_models_py3.py deleted file mode 100644 index e17f94798176..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_models_py3.py +++ /dev/null @@ -1,3656 +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 AdditionalConfiguration(_serialization.Model): - """Additional Configuration details. - - All required parameters must be populated in order to send to Azure. - - :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the - configuration. Required. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar quantity: Quantity of the product. Required. - :vartype quantity: int - """ - - _validation = { - "hierarchy_information": {"required": True}, - "quantity": {"required": True}, - } - - _attribute_map = { - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "quantity": {"key": "quantity", "type": "int"}, - } - - def __init__(self, *, hierarchy_information: "_models.HierarchyInformation", quantity: int, **kwargs: Any) -> None: - """ - :keyword hierarchy_information: Hierarchy of the product which uniquely identifies the - configuration. Required. - :paramtype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :keyword quantity: Quantity of the product. Required. - :paramtype quantity: int - """ - super().__init__(**kwargs) - self.hierarchy_information = hierarchy_information - self.quantity = quantity - - -class AddressDetails(_serialization.Model): - """Address details for an order item. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar forward_address: Customer address and contact details. Required. - :vartype forward_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties - :ivar return_address: Return shipping address. - :vartype return_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties - """ - - _validation = { - "forward_address": {"required": True}, - "return_address": {"readonly": True}, - } - - _attribute_map = { - "forward_address": {"key": "forwardAddress", "type": "AddressProperties"}, - "return_address": {"key": "returnAddress", "type": "AddressProperties"}, - } - - def __init__(self, *, forward_address: "_models.AddressProperties", **kwargs: Any) -> None: - """ - :keyword forward_address: Customer address and contact details. Required. - :paramtype forward_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties - """ - super().__init__(**kwargs) - self.forward_address = forward_address - self.return_address = None - - -class AddressProperties(_serialization.Model): - """Address Properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar shipping_address: Shipping details for the address. - :vartype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress - :ivar contact_details: Contact details for the address. Required. - :vartype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails - :ivar address_validation_status: Status of address validation. Known values are: "Valid", - "Invalid", and "Ambiguous". - :vartype address_validation_status: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressValidationStatus - """ - - _validation = { - "contact_details": {"required": True}, - "address_validation_status": {"readonly": True}, - } - - _attribute_map = { - "shipping_address": {"key": "shippingAddress", "type": "ShippingAddress"}, - "contact_details": {"key": "contactDetails", "type": "ContactDetails"}, - "address_validation_status": {"key": "addressValidationStatus", "type": "str"}, - } - - def __init__( - self, - *, - contact_details: "_models.ContactDetails", - shipping_address: Optional["_models.ShippingAddress"] = None, - **kwargs: Any - ) -> None: - """ - :keyword shipping_address: Shipping details for the address. - :paramtype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress - :keyword contact_details: Contact details for the address. Required. - :paramtype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails - """ - super().__init__(**kwargs) - self.shipping_address = shipping_address - self.contact_details = contact_details - self.address_validation_status = None - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class AddressResource(TrackedResource): - """Address Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SystemData - :ivar shipping_address: Shipping details for the address. - :vartype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress - :ivar contact_details: Contact details for the address. Required. - :vartype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails - :ivar address_validation_status: Status of address validation. Known values are: "Valid", - "Invalid", and "Ambiguous". - :vartype address_validation_status: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressValidationStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "system_data": {"readonly": True}, - "contact_details": {"required": True}, - "address_validation_status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, - "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, - "address_validation_status": {"key": "properties.addressValidationStatus", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - contact_details: "_models.ContactDetails", - tags: Optional[Dict[str, str]] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword shipping_address: Shipping details for the address. - :paramtype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress - :keyword contact_details: Contact details for the address. Required. - :paramtype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails - """ - super().__init__(tags=tags, location=location, **kwargs) - self.system_data = None - self.shipping_address = shipping_address - self.contact_details = contact_details - self.address_validation_status = None - - -class AddressResourceList(_serialization.Model): - """Address Resource Collection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of address resources. - :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :ivar next_link: Link for the next set of job resources. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AddressResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword next_link: Link for the next set of job resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class AddressUpdateParameter(_serialization.Model): - """The Address update parameters. - - :ivar tags: The list of key value pairs that describe the resource. These tags can be used in - viewing and grouping this resource (across resource groups). - :vartype tags: dict[str, str] - :ivar shipping_address: Shipping details for the address. - :vartype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress - :ivar contact_details: Contact details for the address. - :vartype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "shipping_address": {"key": "properties.shippingAddress", "type": "ShippingAddress"}, - "contact_details": {"key": "properties.contactDetails", "type": "ContactDetails"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - shipping_address: Optional["_models.ShippingAddress"] = None, - contact_details: Optional["_models.ContactDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: The list of key value pairs that describe the resource. These tags can be used - in viewing and grouping this resource (across resource groups). - :paramtype tags: dict[str, str] - :keyword shipping_address: Shipping details for the address. - :paramtype shipping_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ShippingAddress - :keyword contact_details: Contact details for the address. - :paramtype contact_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ContactDetails - """ - super().__init__(**kwargs) - self.tags = tags - self.shipping_address = shipping_address - self.contact_details = contact_details - - -class AvailabilityInformation(_serialization.Model): - """Availability information of a product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar availability_stage: Current availability stage of the product. Known values are: - "Available", "Preview", "Signup", "Discoverable", "ComingSoon", "Unavailable", and - "Deprecated". - :vartype availability_stage: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityStage - :ivar disabled_reason: Reason why the product is disabled. Known values are: "None", "Country", - "Region", "Feature", "OfferType", "NoSubscriptionInfo", "NotAvailable", and "OutOfStock". - :vartype disabled_reason: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisabledReason - :ivar disabled_reason_message: Message for why the product is disabled. - :vartype disabled_reason_message: str - """ - - _validation = { - "availability_stage": {"readonly": True}, - "disabled_reason": {"readonly": True}, - "disabled_reason_message": {"readonly": True}, - } - - _attribute_map = { - "availability_stage": {"key": "availabilityStage", "type": "str"}, - "disabled_reason": {"key": "disabledReason", "type": "str"}, - "disabled_reason_message": {"key": "disabledReasonMessage", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.availability_stage = None - self.disabled_reason = None - self.disabled_reason_message = None - - -class BasicInformation(_serialization.Model): - """Basic information for any product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.fulfilled_by = None - - -class BillingMeterDetails(_serialization.Model): - """Holds billing meter details for each type of billing. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Represents Billing type name. - :vartype name: str - :ivar meter_details: Represents MeterDetails. - :vartype meter_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.MeterDetails - :ivar metering_type: Represents Metering type (eg one-time or recurrent). Known values are: - "OneTime", "Recurring", and "Adhoc". - :vartype metering_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.MeteringType - :ivar frequency: Frequency of recurrence. - :vartype frequency: str - """ - - _validation = { - "name": {"readonly": True}, - "meter_details": {"readonly": True}, - "metering_type": {"readonly": True}, - "frequency": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "meter_details": {"key": "meterDetails", "type": "MeterDetails"}, - "metering_type": {"key": "meteringType", "type": "str"}, - "frequency": {"key": "frequency", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.meter_details = None - self.metering_type = None - self.frequency = None - - -class CancellationReason(_serialization.Model): - """Reason for cancellation. - - All required parameters must be populated in order to send to Azure. - - :ivar reason: Reason for cancellation. Required. - :vartype reason: str - """ - - _validation = { - "reason": {"required": True}, - } - - _attribute_map = { - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: str, **kwargs: Any) -> None: - """ - :keyword reason: Reason for cancellation. Required. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.reason = reason - - -class CategoryInformation(_serialization.Model): - """Category related properties of a child configuration. - - :ivar category_name: Category name of the child configuration. - :vartype category_name: str - :ivar category_display_name: Category display name of the child configuration. - :vartype category_display_name: str - :ivar description: Description text for the category. - :vartype description: str - :ivar links: Links for the category. - :vartype links: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Link] - """ - - _attribute_map = { - "category_name": {"key": "categoryName", "type": "str"}, - "category_display_name": {"key": "categoryDisplayName", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "links": {"key": "links", "type": "[Link]"}, - } - - def __init__( - self, - *, - category_name: Optional[str] = None, - category_display_name: Optional[str] = None, - description: Optional[str] = None, - links: Optional[List["_models.Link"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword category_name: Category name of the child configuration. - :paramtype category_name: str - :keyword category_display_name: Category display name of the child configuration. - :paramtype category_display_name: str - :keyword description: Description text for the category. - :paramtype description: str - :keyword links: Links for the category. - :paramtype links: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Link] - """ - super().__init__(**kwargs) - self.category_name = category_name - self.category_display_name = category_display_name - self.description = description - self.links = links - - -class ChildConfiguration(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Child configuration object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar child_configuration_type: Child configuration type. Known values are: - "DeviceConfiguration" and "AdditionalConfiguration". - :vartype child_configuration_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType - :ivar is_part_of_base_configuration: Flag to indicate if the child configuration is part of the - base configuration, which means the customer need not pass this configuration in - OptInAdditionalConfigurations while placing an order, it will be shipped by default. - :vartype is_part_of_base_configuration: bool - :ivar minimum_quantity: Minimum quantity a customer can order while choosing this - configuration. - :vartype minimum_quantity: int - :ivar maximum_quantity: Maximum quantity a customer can order while choosing this - configuration. - :vartype maximum_quantity: int - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Dimensions - :ivar child_configuration_types: Different types of child configurations which exist for this - configuration, these can be used to populate the child configuration filter. - :vartype child_configuration_types: list[str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] - :ivar grouped_child_configurations: Child configurations present for the configuration after - applying child configuration filter, grouped by the category name of the child configuration. - :vartype grouped_child_configurations: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.GroupedChildConfigurations] - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - """ - - _validation = { - "child_configuration_type": {"readonly": True}, - "is_part_of_base_configuration": {"readonly": True}, - "minimum_quantity": {"readonly": True}, - "maximum_quantity": {"readonly": True}, - "specifications": {"readonly": True}, - "dimensions": {"readonly": True}, - "child_configuration_types": {"readonly": True}, - "grouped_child_configurations": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - } - - _attribute_map = { - "child_configuration_type": {"key": "properties.childConfigurationType", "type": "str"}, - "is_part_of_base_configuration": {"key": "properties.isPartOfBaseConfiguration", "type": "bool"}, - "minimum_quantity": {"key": "properties.minimumQuantity", "type": "int"}, - "maximum_quantity": {"key": "properties.maximumQuantity", "type": "int"}, - "specifications": {"key": "properties.specifications", "type": "[Specification]"}, - "dimensions": {"key": "properties.dimensions", "type": "Dimensions"}, - "child_configuration_types": {"key": "properties.childConfigurationTypes", "type": "[str]"}, - "grouped_child_configurations": { - "key": "properties.groupedChildConfigurations", - "type": "[GroupedChildConfigurations]", - }, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.child_configuration_type = None - self.is_part_of_base_configuration = None - self.minimum_quantity = None - self.maximum_quantity = None - self.specifications = None - self.dimensions = None - self.child_configuration_types = None - self.grouped_child_configurations = None - self.filterable_properties = None - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.fulfilled_by = None - - -class ChildConfigurationFilter(_serialization.Model): - """Child configuration filter. - - :ivar hierarchy_informations: The list of child configuration hierarchy customer wants to - filter for the given configuration. - :vartype hierarchy_informations: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation] - :ivar child_configuration_types: Filter to fetch all child configurations belonging to the - given list of configuration types. - :vartype child_configuration_types: list[str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] - """ - - _attribute_map = { - "hierarchy_informations": {"key": "hierarchyInformations", "type": "[HierarchyInformation]"}, - "child_configuration_types": {"key": "childConfigurationTypes", "type": "[str]"}, - } - - def __init__( - self, - *, - hierarchy_informations: Optional[List["_models.HierarchyInformation"]] = None, - child_configuration_types: Optional[List[Union[str, "_models.ChildConfigurationType"]]] = None, - **kwargs: Any - ) -> None: - """ - :keyword hierarchy_informations: The list of child configuration hierarchy customer wants to - filter for the given configuration. - :paramtype hierarchy_informations: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation] - :keyword child_configuration_types: Filter to fetch all child configurations belonging to the - given list of configuration types. - :paramtype child_configuration_types: list[str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] - """ - super().__init__(**kwargs) - self.hierarchy_informations = hierarchy_informations - self.child_configuration_types = child_configuration_types - - -class CommonProperties(BasicInformation): - """Represents common properties across product hierarchy. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.filterable_properties = None - - -class Configuration(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Configuration object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Dimensions - :ivar child_configuration_types: Different types of child configurations which exist for this - configuration, these can be used to populate the child configuration filter. - :vartype child_configuration_types: list[str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] - :ivar grouped_child_configurations: Child configurations present for the configuration after - applying child configuration filter, grouped by the category name of the child configuration. - :vartype grouped_child_configurations: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.GroupedChildConfigurations] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "specifications": {"readonly": True}, - "dimensions": {"readonly": True}, - "child_configuration_types": {"readonly": True}, - "grouped_child_configurations": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "specifications": {"key": "properties.specifications", "type": "[Specification]"}, - "dimensions": {"key": "properties.dimensions", "type": "Dimensions"}, - "child_configuration_types": {"key": "properties.childConfigurationTypes", "type": "[str]"}, - "grouped_child_configurations": { - "key": "properties.groupedChildConfigurations", - "type": "[GroupedChildConfigurations]", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.fulfilled_by = None - self.filterable_properties = None - self.specifications = None - self.dimensions = None - self.child_configuration_types = None - self.grouped_child_configurations = None - - -class ConfigurationDeviceDetails(_serialization.Model): - """Device details for configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_info: Display details of the product. - :vartype display_info: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisplayInfo - :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the - configuration. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar quantity: Quantity of the product. - :vartype quantity: int - :ivar identification_type: Identification type of the configuration. Known values are: - "NotSupported" and "SerialNumber". - :vartype identification_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.IdentificationType - :ivar device_details: List of device details. - :vartype device_details: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.DeviceDetails] - """ - - _validation = { - "hierarchy_information": {"readonly": True}, - "quantity": {"readonly": True}, - "identification_type": {"readonly": True}, - "device_details": {"readonly": True}, - } - - _attribute_map = { - "display_info": {"key": "displayInfo", "type": "DisplayInfo"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "quantity": {"key": "quantity", "type": "int"}, - "identification_type": {"key": "identificationType", "type": "str"}, - "device_details": {"key": "deviceDetails", "type": "[DeviceDetails]"}, - } - - def __init__(self, *, display_info: Optional["_models.DisplayInfo"] = None, **kwargs: Any) -> None: - """ - :keyword display_info: Display details of the product. - :paramtype display_info: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisplayInfo - """ - super().__init__(**kwargs) - self.display_info = display_info - self.hierarchy_information = None - self.quantity = None - self.identification_type = None - self.device_details = None - - -class ConfigurationFilter(_serialization.Model): - """Configuration filters. - - All required parameters must be populated in order to send to Azure. - - :ivar hierarchy_information: Product hierarchy information. Required. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar filterable_property: Filters specific to product. - :vartype filterable_property: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar child_configuration_filter: Filter to fetch specific child configurations that exist in - the configuration. This must be passed to either fetch a list of specific child configurations, - or all child configurations of specific types of child configurations. - :vartype child_configuration_filter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationFilter - """ - - _validation = { - "hierarchy_information": {"required": True}, - } - - _attribute_map = { - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "filterable_property": {"key": "filterableProperty", "type": "[FilterableProperty]"}, - "child_configuration_filter": {"key": "childConfigurationFilter", "type": "ChildConfigurationFilter"}, - } - - def __init__( - self, - *, - hierarchy_information: "_models.HierarchyInformation", - filterable_property: Optional[List["_models.FilterableProperty"]] = None, - child_configuration_filter: Optional["_models.ChildConfigurationFilter"] = None, - **kwargs: Any - ) -> None: - """ - :keyword hierarchy_information: Product hierarchy information. Required. - :paramtype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :keyword filterable_property: Filters specific to product. - :paramtype filterable_property: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :keyword child_configuration_filter: Filter to fetch specific child configurations that exist - in the configuration. This must be passed to either fetch a list of specific child - configurations, or all child configurations of specific types of child configurations. - :paramtype child_configuration_filter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationFilter - """ - super().__init__(**kwargs) - self.hierarchy_information = hierarchy_information - self.filterable_property = filterable_property - self.child_configuration_filter = child_configuration_filter - - -class ConfigurationProperties(CommonProperties): # pylint: disable=too-many-instance-attributes - """Properties of configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar specifications: Specifications of the configuration. - :vartype specifications: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Specification] - :ivar dimensions: Dimensions of the configuration. - :vartype dimensions: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Dimensions - :ivar child_configuration_types: Different types of child configurations which exist for this - configuration, these can be used to populate the child configuration filter. - :vartype child_configuration_types: list[str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfigurationType] - :ivar grouped_child_configurations: Child configurations present for the configuration after - applying child configuration filter, grouped by the category name of the child configuration. - :vartype grouped_child_configurations: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.GroupedChildConfigurations] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "specifications": {"readonly": True}, - "dimensions": {"readonly": True}, - "child_configuration_types": {"readonly": True}, - "grouped_child_configurations": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - "specifications": {"key": "specifications", "type": "[Specification]"}, - "dimensions": {"key": "dimensions", "type": "Dimensions"}, - "child_configuration_types": {"key": "childConfigurationTypes", "type": "[str]"}, - "grouped_child_configurations": {"key": "groupedChildConfigurations", "type": "[GroupedChildConfigurations]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.specifications = None - self.dimensions = None - self.child_configuration_types = None - self.grouped_child_configurations = None - - -class Configurations(_serialization.Model): - """The list of configurations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of configurations. - :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] - :ivar next_link: Link for the next set of configurations. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Configuration]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword next_link: Link for the next set of configurations. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class ConfigurationsRequest(_serialization.Model): - """Configuration request object. - - :ivar configuration_filter: Holds details about product hierarchy information and filterable - property. - :vartype configuration_filter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationFilter - :ivar customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :vartype customer_subscription_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionDetails - """ - - _attribute_map = { - "configuration_filter": {"key": "configurationFilter", "type": "ConfigurationFilter"}, - "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, - } - - def __init__( - self, - *, - configuration_filter: Optional["_models.ConfigurationFilter"] = None, - customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword configuration_filter: Holds details about product hierarchy information and filterable - property. - :paramtype configuration_filter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationFilter - :keyword customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :paramtype customer_subscription_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionDetails - """ - super().__init__(**kwargs) - self.configuration_filter = configuration_filter - self.customer_subscription_details = customer_subscription_details - - -class ContactDetails(_serialization.Model): - """Contact Details. - - All required parameters must be populated in order to send to Azure. - - :ivar contact_name: Contact name of the person. Required. - :vartype contact_name: str - :ivar phone: Phone number of the contact person. Required. - :vartype phone: str - :ivar phone_extension: Phone extension number of the contact person. - :vartype phone_extension: str - :ivar mobile: Mobile number of the contact person. - :vartype mobile: str - :ivar email_list: List of Email-ids to be notified about job progress. Required. - :vartype email_list: list[str] - """ - - _validation = { - "contact_name": {"required": True}, - "phone": {"required": True}, - "email_list": {"required": True}, - } - - _attribute_map = { - "contact_name": {"key": "contactName", "type": "str"}, - "phone": {"key": "phone", "type": "str"}, - "phone_extension": {"key": "phoneExtension", "type": "str"}, - "mobile": {"key": "mobile", "type": "str"}, - "email_list": {"key": "emailList", "type": "[str]"}, - } - - def __init__( - self, - *, - contact_name: str, - phone: str, - email_list: List[str], - phone_extension: Optional[str] = None, - mobile: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_name: Contact name of the person. Required. - :paramtype contact_name: str - :keyword phone: Phone number of the contact person. Required. - :paramtype phone: str - :keyword phone_extension: Phone extension number of the contact person. - :paramtype phone_extension: str - :keyword mobile: Mobile number of the contact person. - :paramtype mobile: str - :keyword email_list: List of Email-ids to be notified about job progress. Required. - :paramtype email_list: list[str] - """ - super().__init__(**kwargs) - self.contact_name = contact_name - self.phone = phone - self.phone_extension = phone_extension - self.mobile = mobile - self.email_list = email_list - - -class CostInformation(_serialization.Model): - """Cost information for the product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar billing_meter_details: Details on the various billing aspects for the product system. - :vartype billing_meter_details: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.BillingMeterDetails] - :ivar billing_info_url: Default url to display billing information. - :vartype billing_info_url: str - """ - - _validation = { - "billing_meter_details": {"readonly": True}, - "billing_info_url": {"readonly": True}, - } - - _attribute_map = { - "billing_meter_details": {"key": "billingMeterDetails", "type": "[BillingMeterDetails]"}, - "billing_info_url": {"key": "billingInfoUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.billing_meter_details = None - self.billing_info_url = None - - -class CustomerSubscriptionDetails(_serialization.Model): - """Holds Customer subscription details. Clients can display available products to unregistered - customers by explicitly passing subscription details. - - All required parameters must be populated in order to send to Azure. - - :ivar registered_features: List of registered feature flags for subscription. - :vartype registered_features: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionRegisteredFeatures] - :ivar location_placement_id: Location placement Id of a subscription. - :vartype location_placement_id: str - :ivar quota_id: Quota ID of a subscription. Required. - :vartype quota_id: str - """ - - _validation = { - "quota_id": {"required": True}, - } - - _attribute_map = { - "registered_features": {"key": "registeredFeatures", "type": "[CustomerSubscriptionRegisteredFeatures]"}, - "location_placement_id": {"key": "locationPlacementId", "type": "str"}, - "quota_id": {"key": "quotaId", "type": "str"}, - } - - def __init__( - self, - *, - quota_id: str, - registered_features: Optional[List["_models.CustomerSubscriptionRegisteredFeatures"]] = None, - location_placement_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword registered_features: List of registered feature flags for subscription. - :paramtype registered_features: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionRegisteredFeatures] - :keyword location_placement_id: Location placement Id of a subscription. - :paramtype location_placement_id: str - :keyword quota_id: Quota ID of a subscription. Required. - :paramtype quota_id: str - """ - super().__init__(**kwargs) - self.registered_features = registered_features - self.location_placement_id = location_placement_id - self.quota_id = quota_id - - -class CustomerSubscriptionRegisteredFeatures(_serialization.Model): - """Represents subscription registered features. - - :ivar name: Name of subscription registered feature. - :vartype name: str - :ivar state: State of subscription registered feature. - :vartype state: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "state": {"key": "state", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, state: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Name of subscription registered feature. - :paramtype name: str - :keyword state: State of subscription registered feature. - :paramtype state: str - """ - super().__init__(**kwargs) - self.name = name - self.state = state - - -class Description(_serialization.Model): - """Description related properties of a product system. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description_type: Type of description. "Base" - :vartype description_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DescriptionType - :ivar short_description: Short description of the product system. - :vartype short_description: str - :ivar long_description: Long description of the product system. - :vartype long_description: str - :ivar keywords: Keywords for the product system. - :vartype keywords: list[str] - :ivar attributes: Attributes for the product system. - :vartype attributes: list[str] - :ivar links: Links for the product system. - :vartype links: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Link] - """ - - _validation = { - "description_type": {"readonly": True}, - "short_description": {"readonly": True}, - "long_description": {"readonly": True}, - "keywords": {"readonly": True}, - "attributes": {"readonly": True}, - "links": {"readonly": True}, - } - - _attribute_map = { - "description_type": {"key": "descriptionType", "type": "str"}, - "short_description": {"key": "shortDescription", "type": "str"}, - "long_description": {"key": "longDescription", "type": "str"}, - "keywords": {"key": "keywords", "type": "[str]"}, - "attributes": {"key": "attributes", "type": "[str]"}, - "links": {"key": "links", "type": "[Link]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.description_type = None - self.short_description = None - self.long_description = None - self.keywords = None - self.attributes = None - self.links = None - - -class DeviceDetails(_serialization.Model): - """Device details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar serial_number: Device serial number. - :vartype serial_number: str - :ivar management_resource_id: Management Resource Id. - :vartype management_resource_id: str - :ivar management_resource_tenant_id: Management Resource Tenant ID. - :vartype management_resource_tenant_id: str - """ - - _validation = { - "serial_number": {"readonly": True}, - "management_resource_id": {"readonly": True}, - "management_resource_tenant_id": {"readonly": True}, - } - - _attribute_map = { - "serial_number": {"key": "serialNumber", "type": "str"}, - "management_resource_id": {"key": "managementResourceId", "type": "str"}, - "management_resource_tenant_id": {"key": "managementResourceTenantId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.serial_number = None - self.management_resource_id = None - self.management_resource_tenant_id = None - - -class Dimensions(_serialization.Model): - """Dimensions of a configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar length: Length of the device. - :vartype length: float - :ivar height: Height of the device. - :vartype height: float - :ivar width: Width of the device. - :vartype width: float - :ivar length_height_unit: Unit for the dimensions of length, height and width. Known values - are: "IN" and "CM". - :vartype length_height_unit: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.LengthHeightUnit - :ivar weight: Weight of the device. - :vartype weight: float - :ivar depth: Depth of the device. - :vartype depth: float - :ivar weight_unit: Unit for the dimensions of weight. Known values are: "LBS" and "KGS". - :vartype weight_unit: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.WeightMeasurementUnit - """ - - _validation = { - "length": {"readonly": True}, - "height": {"readonly": True}, - "width": {"readonly": True}, - "length_height_unit": {"readonly": True}, - "weight": {"readonly": True}, - "depth": {"readonly": True}, - "weight_unit": {"readonly": True}, - } - - _attribute_map = { - "length": {"key": "length", "type": "float"}, - "height": {"key": "height", "type": "float"}, - "width": {"key": "width", "type": "float"}, - "length_height_unit": {"key": "lengthHeightUnit", "type": "str"}, - "weight": {"key": "weight", "type": "float"}, - "depth": {"key": "depth", "type": "float"}, - "weight_unit": {"key": "weightUnit", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.length = None - self.height = None - self.width = None - self.length_height_unit = None - self.weight = None - self.depth = None - self.weight_unit = None - - -class DisplayInfo(_serialization.Model): - """Describes product display information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar product_family_display_name: Product family display name. - :vartype product_family_display_name: str - :ivar configuration_display_name: Configuration display name. - :vartype configuration_display_name: str - """ - - _validation = { - "product_family_display_name": {"readonly": True}, - "configuration_display_name": {"readonly": True}, - } - - _attribute_map = { - "product_family_display_name": {"key": "productFamilyDisplayName", "type": "str"}, - "configuration_display_name": {"key": "configurationDisplayName", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.product_family_display_name = None - self.configuration_display_name = None - - -class EncryptionPreferences(_serialization.Model): - """Preferences related to the double encryption. - - :ivar double_encryption_status: Double encryption status as entered by the customer. It is - compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known - values are: "Disabled" and "Enabled". - :vartype double_encryption_status: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DoubleEncryptionStatus - """ - - _attribute_map = { - "double_encryption_status": {"key": "doubleEncryptionStatus", "type": "str"}, - } - - def __init__( - self, *, double_encryption_status: Optional[Union[str, "_models.DoubleEncryptionStatus"]] = None, **kwargs: Any - ) -> None: - """ - :keyword double_encryption_status: Double encryption status as entered by the customer. It is - compulsory to give this parameter if the 'Deny' or 'Disabled' policy is configured. Known - values are: "Disabled" and "Enabled". - :paramtype double_encryption_status: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DoubleEncryptionStatus - """ - super().__init__(**kwargs) - self.double_encryption_status = double_encryption_status - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class FilterableProperty(_serialization.Model): - """Different types of filters supported and its values. - - All required parameters must be populated in order to send to Azure. - - :ivar type: Type of product filter. Required. Known values are: "ShipToCountries" and - "DoubleEncryptionStatus". - :vartype type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SupportedFilterTypes - :ivar supported_values: Values to be filtered. Required. - :vartype supported_values: list[str] - """ - - _validation = { - "type": {"required": True}, - "supported_values": {"required": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "supported_values": {"key": "supportedValues", "type": "[str]"}, - } - - def __init__( - self, *, type: Union[str, "_models.SupportedFilterTypes"], supported_values: List[str], **kwargs: Any - ) -> None: - """ - :keyword type: Type of product filter. Required. Known values are: "ShipToCountries" and - "DoubleEncryptionStatus". - :paramtype type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SupportedFilterTypes - :keyword supported_values: Values to be filtered. Required. - :paramtype supported_values: list[str] - """ - super().__init__(**kwargs) - self.type = type - self.supported_values = supported_values - - -class ForwardShippingDetails(_serialization.Model): - """Forward shipment details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar carrier_display_name: Carrier Name for display purpose. Not to be used for any - processing. - :vartype carrier_display_name: str - :ivar tracking_id: TrackingId of the package. - :vartype tracking_id: str - :ivar tracking_url: TrackingUrl of the package. - :vartype tracking_url: str - """ - - _validation = { - "carrier_name": {"readonly": True}, - "carrier_display_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - "tracking_url": {"readonly": True}, - } - - _attribute_map = { - "carrier_name": {"key": "carrierName", "type": "str"}, - "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = None - - -class GroupedChildConfigurations(_serialization.Model): - """Grouped child configuration object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar category_information: Category information. - :vartype category_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CategoryInformation - :ivar child_configurations: List of child configurations. - :vartype child_configurations: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChildConfiguration] - """ - - _validation = { - "category_information": {"readonly": True}, - "child_configurations": {"readonly": True}, - } - - _attribute_map = { - "category_information": {"key": "categoryInformation", "type": "CategoryInformation"}, - "child_configurations": {"key": "childConfigurations", "type": "[ChildConfiguration]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.category_information = None - self.child_configurations = None - - -class HierarchyInformation(_serialization.Model): - """Holds details about product hierarchy information. - - :ivar product_family_name: Represents product family name that uniquely identifies product - family. - :vartype product_family_name: str - :ivar product_line_name: Represents product line name that uniquely identifies product line. - :vartype product_line_name: str - :ivar product_name: Represents product name that uniquely identifies product. - :vartype product_name: str - :ivar configuration_name: Represents configuration name that uniquely identifies configuration. - :vartype configuration_name: str - """ - - _attribute_map = { - "product_family_name": {"key": "productFamilyName", "type": "str"}, - "product_line_name": {"key": "productLineName", "type": "str"}, - "product_name": {"key": "productName", "type": "str"}, - "configuration_name": {"key": "configurationName", "type": "str"}, - } - - def __init__( - self, - *, - product_family_name: Optional[str] = None, - product_line_name: Optional[str] = None, - product_name: Optional[str] = None, - configuration_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword product_family_name: Represents product family name that uniquely identifies product - family. - :paramtype product_family_name: str - :keyword product_line_name: Represents product line name that uniquely identifies product line. - :paramtype product_line_name: str - :keyword product_name: Represents product name that uniquely identifies product. - :paramtype product_name: str - :keyword configuration_name: Represents configuration name that uniquely identifies - configuration. - :paramtype configuration_name: str - """ - super().__init__(**kwargs) - self.product_family_name = product_family_name - self.product_line_name = product_line_name - self.product_name = product_name - self.configuration_name = configuration_name - - -class ImageInformation(_serialization.Model): - """Image for the product. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar image_type: Type of the image. Known values are: "MainImage", "BulletImage", and - "GenericImage". - :vartype image_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageType - :ivar image_url: Url of the image. - :vartype image_url: str - """ - - _validation = { - "image_type": {"readonly": True}, - "image_url": {"readonly": True}, - } - - _attribute_map = { - "image_type": {"key": "imageType", "type": "str"}, - "image_url": {"key": "imageUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.image_type = None - self.image_url = None - - -class Link(_serialization.Model): - """Returns link related to the product. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar link_type: Type of link. Known values are: "Generic", "TermsAndConditions", - "Specification", "Documentation", "KnowMore", "SignUp", and "Discoverable". - :vartype link_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.LinkType - :ivar link_url: Url of the link. - :vartype link_url: str - """ - - _validation = { - "link_type": {"readonly": True}, - "link_url": {"readonly": True}, - } - - _attribute_map = { - "link_type": {"key": "linkType", "type": "str"}, - "link_url": {"key": "linkUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.link_type = None - self.link_url = None - - -class ManagementResourcePreferences(_serialization.Model): - """Management resource preference to link device. - - :ivar preferred_management_resource_id: Customer preferred Management resource ARM ID. - :vartype preferred_management_resource_id: str - """ - - _attribute_map = { - "preferred_management_resource_id": {"key": "preferredManagementResourceId", "type": "str"}, - } - - def __init__(self, *, preferred_management_resource_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword preferred_management_resource_id: Customer preferred Management resource ARM ID. - :paramtype preferred_management_resource_id: str - """ - super().__init__(**kwargs) - self.preferred_management_resource_id = preferred_management_resource_id - - -class MeterDetails(_serialization.Model): - """Holds details about billing type and its meter guids. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - Pav2MeterDetails, PurchaseMeterDetails - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". - :vartype billing_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChargingType - """ - - _validation = { - "billing_type": {"required": True}, - "multiplier": {"readonly": True}, - "charging_type": {"readonly": True}, - } - - _attribute_map = { - "billing_type": {"key": "billingType", "type": "str"}, - "multiplier": {"key": "multiplier", "type": "float"}, - "charging_type": {"key": "chargingType", "type": "str"}, - } - - _subtype_map = {"billing_type": {"Pav2": "Pav2MeterDetails", "Purchase": "PurchaseMeterDetails"}} - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.billing_type: Optional[str] = None - self.multiplier = None - self.charging_type = None - - -class NotificationPreference(_serialization.Model): - """Notification preference for a job stage. - - All required parameters must be populated in order to send to Azure. - - :ivar stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". - :vartype stage_name: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.NotificationStageName - :ivar send_notification: Notification is required or not. Required. - :vartype send_notification: bool - """ - - _validation = { - "stage_name": {"required": True}, - "send_notification": {"required": True}, - } - - _attribute_map = { - "stage_name": {"key": "stageName", "type": "str"}, - "send_notification": {"key": "sendNotification", "type": "bool"}, - } - - def __init__( - self, *, stage_name: Union[str, "_models.NotificationStageName"], send_notification: bool, **kwargs: Any - ) -> None: - """ - :keyword stage_name: Name of the stage. Required. Known values are: "Shipped" and "Delivered". - :paramtype stage_name: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.NotificationStageName - :keyword send_notification: Notification is required or not. Required. - :paramtype send_notification: bool - """ - super().__init__(**kwargs) - self.stage_name = stage_name - self.send_notification = send_notification - - -class Operation(_serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ActionType - """ - - _validation = { - "name": {"readonly": True}, - "is_data_action": {"readonly": True}, - "origin": {"readonly": True}, - "action_type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "action_type": {"key": "actionType", "type": "str"}, - } - - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(_serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - "provider": {"readonly": True}, - "resource": {"readonly": True}, - "operation": {"readonly": True}, - "description": {"readonly": True}, - } - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link - to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class OrderItemDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Order item details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar product_details: Unique identifier for configuration. Required. - :vartype product_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductDetails - :ivar order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". - :vartype order_item_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemType - :ivar order_item_mode: Defines the mode of the Order item. Known values are: "Default" and - "DoNotFulfill". - :vartype order_item_mode: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderMode - :ivar current_stage: Current Order item Status. - :vartype current_stage: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageDetails - :ivar order_item_stage_history: Order item status history. - :vartype order_item_stage_history: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageDetails] - :ivar preferences: Customer notification Preferences. - :vartype preferences: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Preferences - :ivar forward_shipping_details: Forward Package Shipping details. - :vartype forward_shipping_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ForwardShippingDetails - :ivar reverse_shipping_details: Reverse Package Shipping details. - :vartype reverse_shipping_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReverseShippingDetails - :ivar notification_email_list: Additional notification email list. - :vartype notification_email_list: list[str] - :ivar cancellation_reason: Cancellation reason. - :vartype cancellation_reason: str - :ivar cancellation_status: Describes whether the order item is cancellable or not. Known values - are: "Cancellable", "CancellableWithFee", and "NotCancellable". - :vartype cancellation_status: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemCancellationEnum - :ivar deletion_status: Describes whether the order item is deletable or not. Known values are: - "Allowed" and "NotAllowed". - :vartype deletion_status: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ActionStatusEnum - :ivar return_reason: Return reason. - :vartype return_reason: str - :ivar return_status: Describes whether the order item is returnable or not. Known values are: - "Returnable", "ReturnableWithFee", and "NotReturnable". - :vartype return_status: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemReturnEnum - :ivar management_rp_details_list: List of parent RP details supported for configuration. - :vartype management_rp_details_list: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] - :ivar error: Top level error for the job. - :vartype error: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ErrorDetail - """ - - _validation = { - "product_details": {"required": True}, - "order_item_type": {"required": True}, - "current_stage": {"readonly": True}, - "order_item_stage_history": {"readonly": True}, - "forward_shipping_details": {"readonly": True}, - "reverse_shipping_details": {"readonly": True}, - "cancellation_reason": {"readonly": True}, - "cancellation_status": {"readonly": True}, - "deletion_status": {"readonly": True}, - "return_reason": {"readonly": True}, - "return_status": {"readonly": True}, - "management_rp_details_list": {"readonly": True}, - "error": {"readonly": True}, - } - - _attribute_map = { - "product_details": {"key": "productDetails", "type": "ProductDetails"}, - "order_item_type": {"key": "orderItemType", "type": "str"}, - "order_item_mode": {"key": "orderItemMode", "type": "str"}, - "current_stage": {"key": "currentStage", "type": "StageDetails"}, - "order_item_stage_history": {"key": "orderItemStageHistory", "type": "[StageDetails]"}, - "preferences": {"key": "preferences", "type": "Preferences"}, - "forward_shipping_details": {"key": "forwardShippingDetails", "type": "ForwardShippingDetails"}, - "reverse_shipping_details": {"key": "reverseShippingDetails", "type": "ReverseShippingDetails"}, - "notification_email_list": {"key": "notificationEmailList", "type": "[str]"}, - "cancellation_reason": {"key": "cancellationReason", "type": "str"}, - "cancellation_status": {"key": "cancellationStatus", "type": "str"}, - "deletion_status": {"key": "deletionStatus", "type": "str"}, - "return_reason": {"key": "returnReason", "type": "str"}, - "return_status": {"key": "returnStatus", "type": "str"}, - "management_rp_details_list": {"key": "managementRpDetailsList", "type": "[ResourceProviderDetails]"}, - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__( - self, - *, - product_details: "_models.ProductDetails", - order_item_type: Union[str, "_models.OrderItemType"], - order_item_mode: Optional[Union[str, "_models.OrderMode"]] = None, - preferences: Optional["_models.Preferences"] = None, - notification_email_list: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword product_details: Unique identifier for configuration. Required. - :paramtype product_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductDetails - :keyword order_item_type: Order item type. Required. Known values are: "Purchase" and "Rental". - :paramtype order_item_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemType - :keyword order_item_mode: Defines the mode of the Order item. Known values are: "Default" and - "DoNotFulfill". - :paramtype order_item_mode: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderMode - :keyword preferences: Customer notification Preferences. - :paramtype preferences: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Preferences - :keyword notification_email_list: Additional notification email list. - :paramtype notification_email_list: list[str] - """ - super().__init__(**kwargs) - self.product_details = product_details - self.order_item_type = order_item_type - self.order_item_mode = order_item_mode - self.current_stage = None - self.order_item_stage_history = None - self.preferences = preferences - self.forward_shipping_details = None - self.reverse_shipping_details = None - self.notification_email_list = notification_email_list - self.cancellation_reason = None - self.cancellation_status = None - self.deletion_status = None - self.return_reason = None - self.return_status = None - self.management_rp_details_list = None - self.error = None - - -class OrderItemResource(TrackedResource): - """Represents order item resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SystemData - :ivar order_item_details: Represents order item details. Required. - :vartype order_item_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemDetails - :ivar address_details: Represents shipping and return address for order item. Required. - :vartype address_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressDetails - :ivar start_time: Start time of order item. - :vartype start_time: ~datetime.datetime - :ivar order_id: Id of the order to which order item belongs to. Required. - :vartype order_id: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "system_data": {"readonly": True}, - "order_item_details": {"required": True}, - "address_details": {"required": True}, - "start_time": {"readonly": True}, - "order_id": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "order_item_details": {"key": "properties.orderItemDetails", "type": "OrderItemDetails"}, - "address_details": {"key": "properties.addressDetails", "type": "AddressDetails"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "order_id": {"key": "properties.orderId", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - order_item_details: "_models.OrderItemDetails", - address_details: "_models.AddressDetails", - order_id: str, - tags: Optional[Dict[str, str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword order_item_details: Represents order item details. Required. - :paramtype order_item_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemDetails - :keyword address_details: Represents shipping and return address for order item. Required. - :paramtype address_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressDetails - :keyword order_id: Id of the order to which order item belongs to. Required. - :paramtype order_id: str - """ - super().__init__(tags=tags, location=location, **kwargs) - self.system_data = None - self.order_item_details = order_item_details - self.address_details = address_details - self.start_time = None - self.order_id = order_id - - -class OrderItemResourceList(_serialization.Model): - """List of order items. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of order item resources. - :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :ivar next_link: Link for the next set of order item resources. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OrderItemResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword next_link: Link for the next set of order item resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class OrderItemUpdateParameter(_serialization.Model): - """Updates order item parameters. - - :ivar tags: The list of key value pairs that describe the resource. These tags can be used in - viewing and grouping this resource (across resource groups). - :vartype tags: dict[str, str] - :ivar forward_address: Updates forward shipping address and contact details. - :vartype forward_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties - :ivar preferences: Customer preference. - :vartype preferences: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Preferences - :ivar notification_email_list: Additional notification email list. - :vartype notification_email_list: list[str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "forward_address": {"key": "properties.forwardAddress", "type": "AddressProperties"}, - "preferences": {"key": "properties.preferences", "type": "Preferences"}, - "notification_email_list": {"key": "properties.notificationEmailList", "type": "[str]"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - forward_address: Optional["_models.AddressProperties"] = None, - preferences: Optional["_models.Preferences"] = None, - notification_email_list: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: The list of key value pairs that describe the resource. These tags can be used - in viewing and grouping this resource (across resource groups). - :paramtype tags: dict[str, str] - :keyword forward_address: Updates forward shipping address and contact details. - :paramtype forward_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties - :keyword preferences: Customer preference. - :paramtype preferences: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Preferences - :keyword notification_email_list: Additional notification email list. - :paramtype notification_email_list: list[str] - """ - super().__init__(**kwargs) - self.tags = tags - self.forward_address = forward_address - self.preferences = preferences - self.notification_email_list = notification_email_list - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - - -class OrderResource(ProxyResource): - """Specifies the properties or parameters for an order. Order is a grouping of one or more order - items. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Represents resource creation and update time. - :vartype system_data: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.SystemData - :ivar order_item_ids: List of order item ARM Ids which are part of an order. - :vartype order_item_ids: list[str] - :ivar current_stage: Order current status. - :vartype current_stage: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageDetails - :ivar order_stage_history: Order status history. - :vartype order_stage_history: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageDetails] - :ivar order_mode: Order mode. Known values are: "Default" and "DoNotFulfill". - :vartype order_mode: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderMode - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "order_item_ids": {"readonly": True}, - "current_stage": {"readonly": True}, - "order_stage_history": {"readonly": True}, - "order_mode": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "order_item_ids": {"key": "properties.orderItemIds", "type": "[str]"}, - "current_stage": {"key": "properties.currentStage", "type": "StageDetails"}, - "order_stage_history": {"key": "properties.orderStageHistory", "type": "[StageDetails]"}, - "order_mode": {"key": "properties.orderMode", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.system_data = None - self.order_item_ids = None - self.current_stage = None - self.order_stage_history = None - self.order_mode = None - - -class OrderResourceList(_serialization.Model): - """List of orders. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of order resources. - :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] - :ivar next_link: Link for the next set of order resources. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OrderResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword next_link: Link for the next set of order resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class Pav2MeterDetails(MeterDetails): - """Billing type PAV2 meter details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". - :vartype billing_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChargingType - :ivar meter_guid: Validation status of requested data center and transport. - :vartype meter_guid: str - """ - - _validation = { - "billing_type": {"required": True}, - "multiplier": {"readonly": True}, - "charging_type": {"readonly": True}, - "meter_guid": {"readonly": True}, - } - - _attribute_map = { - "billing_type": {"key": "billingType", "type": "str"}, - "multiplier": {"key": "multiplier", "type": "float"}, - "charging_type": {"key": "chargingType", "type": "str"}, - "meter_guid": {"key": "meterGuid", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.billing_type: str = "Pav2" - self.meter_guid = None - - -class Preferences(_serialization.Model): - """Preferences related to the order. - - :ivar notification_preferences: Notification preferences. - :vartype notification_preferences: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.NotificationPreference] - :ivar transport_preferences: Preferences related to the shipment logistics of the order. - :vartype transport_preferences: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.TransportPreferences - :ivar encryption_preferences: Preferences related to the Encryption. - :vartype encryption_preferences: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.EncryptionPreferences - :ivar management_resource_preferences: Preferences related to the Management resource. - :vartype management_resource_preferences: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ManagementResourcePreferences - """ - - _attribute_map = { - "notification_preferences": {"key": "notificationPreferences", "type": "[NotificationPreference]"}, - "transport_preferences": {"key": "transportPreferences", "type": "TransportPreferences"}, - "encryption_preferences": {"key": "encryptionPreferences", "type": "EncryptionPreferences"}, - "management_resource_preferences": { - "key": "managementResourcePreferences", - "type": "ManagementResourcePreferences", - }, - } - - def __init__( - self, - *, - notification_preferences: Optional[List["_models.NotificationPreference"]] = None, - transport_preferences: Optional["_models.TransportPreferences"] = None, - encryption_preferences: Optional["_models.EncryptionPreferences"] = None, - management_resource_preferences: Optional["_models.ManagementResourcePreferences"] = None, - **kwargs: Any - ) -> None: - """ - :keyword notification_preferences: Notification preferences. - :paramtype notification_preferences: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.NotificationPreference] - :keyword transport_preferences: Preferences related to the shipment logistics of the order. - :paramtype transport_preferences: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.TransportPreferences - :keyword encryption_preferences: Preferences related to the Encryption. - :paramtype encryption_preferences: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.EncryptionPreferences - :keyword management_resource_preferences: Preferences related to the Management resource. - :paramtype management_resource_preferences: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ManagementResourcePreferences - """ - super().__init__(**kwargs) - self.notification_preferences = notification_preferences - self.transport_preferences = transport_preferences - self.encryption_preferences = encryption_preferences - self.management_resource_preferences = management_resource_preferences - - -class Product(_serialization.Model): - """Represents a product. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "configurations": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "configurations": {"key": "properties.configurations", "type": "[Configuration]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.fulfilled_by = None - self.filterable_properties = None - self.configurations = None - - -class ProductDetails(_serialization.Model): - """Represents product details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar display_info: Display details of the product. - :vartype display_info: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisplayInfo - :ivar hierarchy_information: Hierarchy of the product which uniquely identifies the product. - Required. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar product_double_encryption_status: Double encryption status of the configuration. - Read-only field. Known values are: "Disabled" and "Enabled". - :vartype product_double_encryption_status: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DoubleEncryptionStatus - :ivar identification_type: Identification type of the configuration. Known values are: - "NotSupported" and "SerialNumber". - :vartype identification_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.IdentificationType - :ivar parent_device_details: Device details of the parent configuration. - :vartype parent_device_details: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DeviceDetails - :ivar opt_in_additional_configurations: List of additional configurations customer wants in the - order item apart from the ones included in the base configuration. - :vartype opt_in_additional_configurations: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AdditionalConfiguration] - :ivar child_configuration_device_details: Details of all child configurations that are part of - the order item. - :vartype child_configuration_device_details: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationDeviceDetails] - """ - - _validation = { - "hierarchy_information": {"required": True}, - "product_double_encryption_status": {"readonly": True}, - "identification_type": {"readonly": True}, - "parent_device_details": {"readonly": True}, - "child_configuration_device_details": {"readonly": True}, - } - - _attribute_map = { - "display_info": {"key": "displayInfo", "type": "DisplayInfo"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "product_double_encryption_status": {"key": "productDoubleEncryptionStatus", "type": "str"}, - "identification_type": {"key": "identificationType", "type": "str"}, - "parent_device_details": {"key": "parentDeviceDetails", "type": "DeviceDetails"}, - "opt_in_additional_configurations": { - "key": "optInAdditionalConfigurations", - "type": "[AdditionalConfiguration]", - }, - "child_configuration_device_details": { - "key": "childConfigurationDeviceDetails", - "type": "[ConfigurationDeviceDetails]", - }, - } - - def __init__( - self, - *, - hierarchy_information: "_models.HierarchyInformation", - display_info: Optional["_models.DisplayInfo"] = None, - opt_in_additional_configurations: Optional[List["_models.AdditionalConfiguration"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword display_info: Display details of the product. - :paramtype display_info: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.DisplayInfo - :keyword hierarchy_information: Hierarchy of the product which uniquely identifies the product. - Required. - :paramtype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :keyword opt_in_additional_configurations: List of additional configurations customer wants in - the order item apart from the ones included in the base configuration. - :paramtype opt_in_additional_configurations: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AdditionalConfiguration] - """ - super().__init__(**kwargs) - self.display_info = display_info - self.hierarchy_information = hierarchy_information - self.product_double_encryption_status = None - self.identification_type = None - self.parent_device_details = None - self.opt_in_additional_configurations = opt_in_additional_configurations - self.child_configuration_device_details = None - - -class ProductFamilies(_serialization.Model): - """The list of product families. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of product families. - :vartype value: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] - :ivar next_link: Link for the next set of product families. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ProductFamily]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword next_link: Link for the next set of product families. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class ProductFamiliesMetadata(_serialization.Model): - """Holds details about product family metadata. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of product family metadata details. - :vartype value: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesMetadataDetails] - :ivar next_link: Link for the next set of product families. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ProductFamiliesMetadataDetails]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class ProductFamiliesMetadataDetails(_serialization.Model): - """Product families metadata details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductLine] - :ivar resource_provider_details: Contains details related to resource provider. - :vartype resource_provider_details: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "product_lines": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, - "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, - } - - def __init__( - self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_provider_details: Contains details related to resource provider. - :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] - """ - super().__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.fulfilled_by = None - self.filterable_properties = None - self.product_lines = None - self.resource_provider_details = resource_provider_details - - -class ProductFamiliesRequest(_serialization.Model): - """The filters for showing the product families. - - All required parameters must be populated in order to send to Azure. - - :ivar filterable_properties: Dictionary of filterable properties on product family. Required. - :vartype filterable_properties: dict[str, - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty]] - :ivar customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :vartype customer_subscription_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionDetails - """ - - _validation = { - "filterable_properties": {"required": True}, - } - - _attribute_map = { - "filterable_properties": {"key": "filterableProperties", "type": "{[FilterableProperty]}"}, - "customer_subscription_details": {"key": "customerSubscriptionDetails", "type": "CustomerSubscriptionDetails"}, - } - - def __init__( - self, - *, - filterable_properties: Dict[str, List["_models.FilterableProperty"]], - customer_subscription_details: Optional["_models.CustomerSubscriptionDetails"] = None, - **kwargs: Any - ) -> None: - """ - :keyword filterable_properties: Dictionary of filterable properties on product family. - Required. - :paramtype filterable_properties: dict[str, - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty]] - :keyword customer_subscription_details: Customer subscription properties. Clients can display - available products to unregistered customers by explicitly passing subscription details. - :paramtype customer_subscription_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CustomerSubscriptionDetails - """ - super().__init__(**kwargs) - self.filterable_properties = filterable_properties - self.customer_subscription_details = customer_subscription_details - - -class ProductFamily(_serialization.Model): - """Product Family. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductLine] - :ivar resource_provider_details: Contains details related to resource provider. - :vartype resource_provider_details: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "product_lines": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "product_lines": {"key": "properties.productLines", "type": "[ProductLine]"}, - "resource_provider_details": {"key": "properties.resourceProviderDetails", "type": "[ResourceProviderDetails]"}, - } - - def __init__( - self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_provider_details: Contains details related to resource provider. - :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] - """ - super().__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.fulfilled_by = None - self.filterable_properties = None - self.product_lines = None - self.resource_provider_details = resource_provider_details - - -class ProductFamilyProperties(CommonProperties): - """Properties of product family. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar product_lines: List of product lines supported in the product family. - :vartype product_lines: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductLine] - :ivar resource_provider_details: Contains details related to resource provider. - :vartype resource_provider_details: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "product_lines": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - "product_lines": {"key": "productLines", "type": "[ProductLine]"}, - "resource_provider_details": {"key": "resourceProviderDetails", "type": "[ResourceProviderDetails]"}, - } - - def __init__( - self, *, resource_provider_details: Optional[List["_models.ResourceProviderDetails"]] = None, **kwargs: Any - ) -> None: - """ - :keyword resource_provider_details: Contains details related to resource provider. - :paramtype resource_provider_details: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ResourceProviderDetails] - """ - super().__init__(**kwargs) - self.product_lines = None - self.resource_provider_details = resource_provider_details - - -class ProductLine(_serialization.Model): - """Product line. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Product] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "products": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "properties.displayName", "type": "str"}, - "description": {"key": "properties.description", "type": "Description"}, - "image_information": {"key": "properties.imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "properties.costInformation", "type": "CostInformation"}, - "availability_information": {"key": "properties.availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "properties.hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "properties.fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "properties.filterableProperties", "type": "[FilterableProperty]"}, - "products": {"key": "properties.products", "type": "[Product]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.display_name = None - self.description = None - self.image_information = None - self.cost_information = None - self.availability_information = None - self.hierarchy_information = None - self.fulfilled_by = None - self.filterable_properties = None - self.products = None - - -class ProductLineProperties(CommonProperties): - """Properties of product line. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar products: List of products in the product line. - :vartype products: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Product] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "products": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - "products": {"key": "products", "type": "[Product]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.products = None - - -class ProductProperties(CommonProperties): - """Properties of product. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: Display Name for the product system. - :vartype display_name: str - :ivar description: Description related to the product system. - :vartype description: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.Description - :ivar image_information: Image information for the product system. - :vartype image_information: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ImageInformation] - :ivar cost_information: Cost information for the product system. - :vartype cost_information: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CostInformation - :ivar availability_information: Availability information of the product system. - :vartype availability_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AvailabilityInformation - :ivar hierarchy_information: Hierarchy information of a product. - :vartype hierarchy_information: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.HierarchyInformation - :ivar fulfilled_by: The entity responsible for fulfillment of the item at the given hierarchy - level. Known values are: "Microsoft" and "External". - :vartype fulfilled_by: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.FulfillmentType - :ivar filterable_properties: List of filters supported for a product. - :vartype filterable_properties: - list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.FilterableProperty] - :ivar configurations: List of configurations for the product. - :vartype configurations: list[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] - """ - - _validation = { - "display_name": {"readonly": True}, - "description": {"readonly": True}, - "image_information": {"readonly": True}, - "cost_information": {"readonly": True}, - "availability_information": {"readonly": True}, - "hierarchy_information": {"readonly": True}, - "fulfilled_by": {"readonly": True}, - "filterable_properties": {"readonly": True}, - "configurations": {"readonly": True}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "description": {"key": "description", "type": "Description"}, - "image_information": {"key": "imageInformation", "type": "[ImageInformation]"}, - "cost_information": {"key": "costInformation", "type": "CostInformation"}, - "availability_information": {"key": "availabilityInformation", "type": "AvailabilityInformation"}, - "hierarchy_information": {"key": "hierarchyInformation", "type": "HierarchyInformation"}, - "fulfilled_by": {"key": "fulfilledBy", "type": "str"}, - "filterable_properties": {"key": "filterableProperties", "type": "[FilterableProperty]"}, - "configurations": {"key": "configurations", "type": "[Configuration]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.configurations = None - - -class PurchaseMeterDetails(MeterDetails): - """Billing type Purchase meter details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar billing_type: Represents billing type. Required. Known values are: "Pav2" and "Purchase". - :vartype billing_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.BillingType - :ivar multiplier: Billing unit applicable for Pav2 billing. - :vartype multiplier: float - :ivar charging_type: Charging type. Known values are: "PerOrder" and "PerDevice". - :vartype charging_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ChargingType - :ivar product_id: Product Id. - :vartype product_id: str - :ivar sku_id: Sku Id. - :vartype sku_id: str - :ivar term_id: Term Id. - :vartype term_id: str - """ - - _validation = { - "billing_type": {"required": True}, - "multiplier": {"readonly": True}, - "charging_type": {"readonly": True}, - "product_id": {"readonly": True}, - "sku_id": {"readonly": True}, - "term_id": {"readonly": True}, - } - - _attribute_map = { - "billing_type": {"key": "billingType", "type": "str"}, - "multiplier": {"key": "multiplier", "type": "float"}, - "charging_type": {"key": "chargingType", "type": "str"}, - "product_id": {"key": "productId", "type": "str"}, - "sku_id": {"key": "skuId", "type": "str"}, - "term_id": {"key": "termId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.billing_type: str = "Purchase" - self.product_id = None - self.sku_id = None - self.term_id = None - - -class ResourceMoveRequest(_serialization.Model): - """ResourceMoveRequest. - - :ivar target_resource_group: - :vartype target_resource_group: str - :ivar resources: - :vartype resources: list[str] - """ - - _attribute_map = { - "target_resource_group": {"key": "targetResourceGroup", "type": "str"}, - "resources": {"key": "resources", "type": "[str]"}, - } - - def __init__( - self, *, target_resource_group: Optional[str] = None, resources: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword target_resource_group: - :paramtype target_resource_group: str - :keyword resources: - :paramtype resources: list[str] - """ - super().__init__(**kwargs) - self.target_resource_group = target_resource_group - self.resources = resources - - -class ResourceProviderDetails(_serialization.Model): - """Management RP details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar resource_provider_namespace: Resource provider namespace. - :vartype resource_provider_namespace: str - """ - - _validation = { - "resource_provider_namespace": {"readonly": True}, - } - - _attribute_map = { - "resource_provider_namespace": {"key": "resourceProviderNamespace", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.resource_provider_namespace = None - - -class ReturnOrderItemDetails(_serialization.Model): - """Return order item request body. - - All required parameters must be populated in order to send to Azure. - - :ivar return_address: Customer return address. - :vartype return_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties - :ivar return_reason: Return Reason. Required. - :vartype return_reason: str - :ivar service_tag: Service tag (located on the bottom-right corner of the device). - :vartype service_tag: str - :ivar shipping_box_required: Shipping Box required. - :vartype shipping_box_required: bool - """ - - _validation = { - "return_reason": {"required": True}, - } - - _attribute_map = { - "return_address": {"key": "returnAddress", "type": "AddressProperties"}, - "return_reason": {"key": "returnReason", "type": "str"}, - "service_tag": {"key": "serviceTag", "type": "str"}, - "shipping_box_required": {"key": "shippingBoxRequired", "type": "bool"}, - } - - def __init__( - self, - *, - return_reason: str, - return_address: Optional["_models.AddressProperties"] = None, - service_tag: Optional[str] = None, - shipping_box_required: bool = False, - **kwargs: Any - ) -> None: - """ - :keyword return_address: Customer return address. - :paramtype return_address: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressProperties - :keyword return_reason: Return Reason. Required. - :paramtype return_reason: str - :keyword service_tag: Service tag (located on the bottom-right corner of the device). - :paramtype service_tag: str - :keyword shipping_box_required: Shipping Box required. - :paramtype shipping_box_required: bool - """ - super().__init__(**kwargs) - self.return_address = return_address - self.return_reason = return_reason - self.service_tag = service_tag - self.shipping_box_required = shipping_box_required - - -class ReverseShippingDetails(_serialization.Model): - """Reverse shipment details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sas_key_for_label: SAS key to download the reverse shipment label of the package. - :vartype sas_key_for_label: str - :ivar carrier_name: Name of the carrier. - :vartype carrier_name: str - :ivar carrier_display_name: Carrier Name for display purpose. Not to be used for any - processing. - :vartype carrier_display_name: str - :ivar tracking_id: TrackingId of the package. - :vartype tracking_id: str - :ivar tracking_url: TrackingUrl of the package. - :vartype tracking_url: str - """ - - _validation = { - "sas_key_for_label": {"readonly": True}, - "carrier_name": {"readonly": True}, - "carrier_display_name": {"readonly": True}, - "tracking_id": {"readonly": True}, - "tracking_url": {"readonly": True}, - } - - _attribute_map = { - "sas_key_for_label": {"key": "sasKeyForLabel", "type": "str"}, - "carrier_name": {"key": "carrierName", "type": "str"}, - "carrier_display_name": {"key": "carrierDisplayName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.sas_key_for_label = None - self.carrier_name = None - self.carrier_display_name = None - self.tracking_id = None - self.tracking_url = None - - -class ShippingAddress(_serialization.Model): - """Shipping address where customer wishes to receive the device. - - All required parameters must be populated in order to send to Azure. - - :ivar street_address1: Street Address line 1. Required. - :vartype street_address1: str - :ivar street_address2: Street Address line 2. - :vartype street_address2: str - :ivar street_address3: Street Address line 3. - :vartype street_address3: str - :ivar city: Name of the City. - :vartype city: str - :ivar state_or_province: Name of the State or Province. - :vartype state_or_province: str - :ivar country: Name of the Country. Required. - :vartype country: str - :ivar postal_code: Postal code. - :vartype postal_code: str - :ivar zip_extended_code: Extended Zip Code. - :vartype zip_extended_code: str - :ivar company_name: Name of the company. - :vartype company_name: str - :ivar address_type: Type of address. Known values are: "None", "Residential", and "Commercial". - :vartype address_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressType - """ - - _validation = { - "street_address1": {"required": True}, - "country": {"required": True}, - } - - _attribute_map = { - "street_address1": {"key": "streetAddress1", "type": "str"}, - "street_address2": {"key": "streetAddress2", "type": "str"}, - "street_address3": {"key": "streetAddress3", "type": "str"}, - "city": {"key": "city", "type": "str"}, - "state_or_province": {"key": "stateOrProvince", "type": "str"}, - "country": {"key": "country", "type": "str"}, - "postal_code": {"key": "postalCode", "type": "str"}, - "zip_extended_code": {"key": "zipExtendedCode", "type": "str"}, - "company_name": {"key": "companyName", "type": "str"}, - "address_type": {"key": "addressType", "type": "str"}, - } - - def __init__( - self, - *, - street_address1: str, - country: str, - street_address2: Optional[str] = None, - street_address3: Optional[str] = None, - city: Optional[str] = None, - state_or_province: Optional[str] = None, - postal_code: Optional[str] = None, - zip_extended_code: Optional[str] = None, - company_name: Optional[str] = None, - address_type: Optional[Union[str, "_models.AddressType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword street_address1: Street Address line 1. Required. - :paramtype street_address1: str - :keyword street_address2: Street Address line 2. - :paramtype street_address2: str - :keyword street_address3: Street Address line 3. - :paramtype street_address3: str - :keyword city: Name of the City. - :paramtype city: str - :keyword state_or_province: Name of the State or Province. - :paramtype state_or_province: str - :keyword country: Name of the Country. Required. - :paramtype country: str - :keyword postal_code: Postal code. - :paramtype postal_code: str - :keyword zip_extended_code: Extended Zip Code. - :paramtype zip_extended_code: str - :keyword company_name: Name of the company. - :paramtype company_name: str - :keyword address_type: Type of address. Known values are: "None", "Residential", and - "Commercial". - :paramtype address_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressType - """ - super().__init__(**kwargs) - self.street_address1 = street_address1 - self.street_address2 = street_address2 - self.street_address3 = street_address3 - self.city = city - self.state_or_province = state_or_province - self.country = country - self.postal_code = postal_code - self.zip_extended_code = zip_extended_code - self.company_name = company_name - self.address_type = address_type - - -class Specification(_serialization.Model): - """Specification of the configurations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the specification. - :vartype name: str - :ivar value: Value of the specification. - :vartype value: str - """ - - _validation = { - "name": {"readonly": True}, - "value": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.value = None - - -class StageDetails(_serialization.Model): - """Resource stage details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar stage_status: Stage status. Known values are: "None", "InProgress", "Succeeded", - "Failed", "Cancelled", and "Cancelling". - :vartype stage_status: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageStatus - :ivar stage_name: Stage name. Known values are: "Placed", "InReview", "Confirmed", - "ReadyToShip", "Shipped", "Delivered", "InUse", "ReturnInitiated", "ReturnPickedUp", - "ReturnedToMicrosoft", "ReturnCompleted", and "Cancelled". - :vartype stage_name: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.StageName - :ivar display_name: Display name of the resource stage. - :vartype display_name: str - :ivar start_time: Stage start time. - :vartype start_time: ~datetime.datetime - """ - - _validation = { - "stage_status": {"readonly": True}, - "stage_name": {"readonly": True}, - "display_name": {"readonly": True}, - "start_time": {"readonly": True}, - } - - _attribute_map = { - "stage_status": {"key": "stageStatus", "type": "str"}, - "stage_name": {"key": "stageName", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "start_time": {"key": "startTime", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.stage_status = None - self.stage_name = None - self.display_name = None - self.start_time = None - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TransportPreferences(_serialization.Model): - """Preferences related to the shipment logistics of the sku. - - All required parameters must be populated in order to send to Azure. - - :ivar preferred_shipment_type: Indicates Shipment Logistics type that the customer preferred. - Required. Known values are: "CustomerManaged" and "MicrosoftManaged". - :vartype preferred_shipment_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.TransportShipmentTypes - """ - - _validation = { - "preferred_shipment_type": {"required": True}, - } - - _attribute_map = { - "preferred_shipment_type": {"key": "preferredShipmentType", "type": "str"}, - } - - def __init__(self, *, preferred_shipment_type: Union[str, "_models.TransportShipmentTypes"], **kwargs: Any) -> None: - """ - :keyword preferred_shipment_type: Indicates Shipment Logistics type that the customer - preferred. Required. Known values are: "CustomerManaged" and "MicrosoftManaged". - :paramtype preferred_shipment_type: str or - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.TransportShipmentTypes - """ - super().__init__(**kwargs) - self.preferred_shipment_type = preferred_shipment_type diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/models/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/__init__.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/__init__.py deleted file mode 100644 index c3b25bc71af1..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._addresses_operations import AddressesOperations -from ._products_and_configurations_operations import ProductsAndConfigurationsOperations -from ._order_items_operations import OrderItemsOperations -from ._orders_operations import OrdersOperations - -from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "AddressesOperations", - "ProductsAndConfigurationsOperations", - "OrderItemsOperations", - "OrdersOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_addresses_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_addresses_operations.py deleted file mode 100644 index a5915d7e38e6..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_addresses_operations.py +++ /dev/null @@ -1,1185 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_request( - subscription_id: str, - *, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request( - resource_group_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(resource_group_name: str, address_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "addressName": _SERIALIZER.url( - "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_request( - resource_group_name: str, address_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "addressName": _SERIALIZER.url( - "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, address_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "addressName": _SERIALIZER.url( - "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, address_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "addressName": _SERIALIZER.url( - "address_name", address_name, "str", max_length=24, min_length=3, pattern=r"^[-\w\.]+$" - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class AddressesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s - :attr:`addresses` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription( - self, filter: Optional[str] = None, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.AddressResource"]: - """List all the addresses available under the subscription. - - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. Default value is None. - :type filter: str - :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses"} - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - filter: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.AddressResource"]: - """List all the addresses available under the given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on shipping address properties. Filter - supports only equals operation. Default value is None. - :type filter: str - :param skip_token: $skipToken is supported on Get list of addresses, which provides the next - page in the list of addresses. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AddressResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.AddressResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - filter=filter, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AddressResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses" - } - - @distributed_trace - def get(self, resource_group_name: str, address_name: str, **kwargs: Any) -> _models.AddressResource: - """Get information about the specified address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AddressResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - address_name=address_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - def _create_initial( - self, - resource_group_name: str, - address_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_resource, (IO, bytes)): - _content = address_resource - else: - _json = self._serialize.body(address_resource, "AddressResource") - - request = build_create_request( - resource_group_name=resource_group_name, - address_name=address_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - address_name: str, - address_resource: _models.AddressResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Create a new address with the specified parameters. Existing address cannot be updated with - this API and should - instead be updated with the Update address API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_resource: Address details from request body. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - address_name: str, - address_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Create a new address with the specified parameters. Existing address cannot be updated with - this API and should - instead be updated with the Update address API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_resource: Address details from request body. Required. - :type address_resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - address_name: str, - address_resource: Union[_models.AddressResource, IO], - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Create a new address with the specified parameters. Existing address cannot be updated with - this API and should - instead be updated with the Update address API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_resource: Address details from request body. Is either a AddressResource type or - a IO type. Required. - :type address_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - address_name=address_name, - address_resource=address_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, address_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - address_name=address_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, address_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete an address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - address_name=address_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - def _update_initial( - self, - resource_group_name: str, - address_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.AddressResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AddressResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(address_update_parameter, (IO, bytes)): - _content = address_update_parameter - else: - _json = self._serialize.body(address_update_parameter, "AddressUpdateParameter") - - request = build_update_request( - resource_group_name=resource_group_name, - address_name=address_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("AddressResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - address_name: str, - address_update_parameter: _models.AddressUpdateParameter, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Update the properties of an existing address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - address_name: str, - address_update_parameter: IO, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Update the properties of an existing address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_update_parameter: Address update parameters from request body. Required. - :type address_update_parameter: IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - address_name: str, - address_update_parameter: Union[_models.AddressUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.AddressResource]: - """Update the properties of an existing address. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param address_name: The name of the address Resource within the specified resource group. - address names must be between 3 and 24 characters in length and use any alphanumeric and - underscore only. Required. - :type address_name: str - :param address_update_parameter: Address update parameters from request body. Is either a - AddressUpdateParameter type or a IO type. Required. - :type address_update_parameter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the job on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either AddressResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.AddressResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AddressResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - address_name=address_name, - address_update_parameter=address_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AddressResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_operations.py deleted file mode 100644 index ec18ed55f986..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_operations.py +++ /dev/null @@ -1,164 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.EdgeOrder/operations") - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class Operations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s - :attr:`operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """List all the supported operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list.metadata = {"url": "/providers/Microsoft.EdgeOrder/operations"} diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_order_items_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_order_items_operations.py deleted file mode 100644 index 497c8487e662..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_order_items_operations.py +++ /dev/null @@ -1,1644 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_request( - subscription_id: str, - *, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request( - resource_group_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, order_item_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_request( - resource_group_name: str, order_item_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, order_item_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - order_item_name: str, - subscription_id: str, - *, - if_match: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_request( - resource_group_name: str, order_item_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_return_method_request( - resource_group_name: str, order_item_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "orderItemName": _SERIALIZER.url("order_item_name", order_item_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class OrderItemsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s - :attr:`order_items` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription( - self, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.OrderItemResource"]: - """List order items at subscription level. - - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. Default value is None. - :type filter: str - :param expand: $expand is supported on parent device details, device details, forward shipping - details and reverse shipping details parameters. Each of these can be provided as a comma - separated list. Parent Device Details for order item provides details on the devices of the - product, Device Details for order item provides details on the devices of the child - configurations of the product, Forward and Reverse Shipping details provide forward and reverse - shipping details respectively. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - filter=filter, - expand=expand, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems"} - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - filter: Optional[str] = None, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.OrderItemResource"]: - """List order items at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param filter: $filter is supported to filter based on order id. Filter supports only equals - operation. Default value is None. - :type filter: str - :param expand: $expand is supported on parent device details, device details, forward shipping - details and reverse shipping details parameters. Each of these can be provided as a comma - separated list. Parent Device Details for order item provides details on the devices of the - product, Device Details for order item provides details on the devices of the child - configurations of the product, Forward and Reverse Shipping details provide forward and reverse - shipping details respectively. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on Get list of order items, which provides the next - page in the list of order items. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderItemResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderItemResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - filter=filter, - expand=expand, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderItemResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems" - } - - @distributed_trace - def get( - self, resource_group_name: str, order_item_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.OrderItemResource: - """Get an order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param expand: $expand is supported on parent device details, device details, forward shipping - details and reverse shipping details parameters. Each of these can be provided as a comma - separated list. Parent Device Details for order item provides details on the devices of the - product, Device Details for order item provides details on the devices of the child - configurations of the product, Forward and Reverse Shipping details provide forward and reverse - shipping details respectively. Default value is None. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderItemResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - def _create_initial( - self, - resource_group_name: str, - order_item_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_resource, (IO, bytes)): - _content = order_item_resource - else: - _json = self._serialize.body(order_item_resource, "OrderItemResource") - - request = build_create_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - def begin_create( - self, - resource_group_name: str, - order_item_name: str, - order_item_resource: _models.OrderItemResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Create an order item. Existing order item cannot be updated with this api and should instead be - updated with the Update order item - API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - order_item_name: str, - order_item_resource: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Create an order item. Existing order item cannot be updated with this api and should instead be - updated with the Update order item - API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_resource: Order item details from request body. Required. - :type order_item_resource: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - order_item_name: str, - order_item_resource: Union[_models.OrderItemResource, IO], - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Create an order item. Existing order item cannot be updated with this api and should instead be - updated with the Update order item - API. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_resource: Order item details from request body. Is either a OrderItemResource - type or a IO type. Required. - :type order_item_resource: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - order_item_resource=order_item_resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, order_item_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - request = build_delete_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @distributed_trace - def begin_delete(self, resource_group_name: str, order_item_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete an order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - order_item_name=order_item_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - def _update_initial( - self, - resource_group_name: str, - order_item_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Optional[_models.OrderItemResource]: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OrderItemResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order_item_update_parameter, (IO, bytes)): - _content = order_item_update_parameter - else: - _json = self._serialize.body(order_item_update_parameter, "OrderItemUpdateParameter") - - request = build_update_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._update_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("OrderItemResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - def begin_update( - self, - resource_group_name: str, - order_item_name: str, - order_item_update_parameter: _models.OrderItemUpdateParameter, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Update the properties of an existing order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_update_parameter: Order item update parameters from request body. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemUpdateParameter - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - order_item_name: str, - order_item_update_parameter: IO, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Update the properties of an existing order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_update_parameter: Order item update parameters from request body. Required. - :type order_item_update_parameter: IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - order_item_name: str, - order_item_update_parameter: Union[_models.OrderItemUpdateParameter, IO], - if_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.OrderItemResource]: - """Update the properties of an existing order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param order_item_update_parameter: Order item update parameters from request body. Is either a - OrderItemUpdateParameter type or a IO type. Required. - :type order_item_update_parameter: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemUpdateParameter or IO - :param if_match: Defines the If-Match condition. The patch will be performed only if the ETag - of the order on the server matches this value. Default value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrderItemResource or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderItemResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrderItemResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - order_item_update_parameter=order_item_update_parameter, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrderItemResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}" - } - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - order_item_name: str, - cancellation_reason: _models.CancellationReason, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Cancel order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CancellationReason - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - order_item_name: str, - cancellation_reason: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Cancel order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param cancellation_reason: Reason for cancellation. Required. - :type cancellation_reason: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - order_item_name: str, - cancellation_reason: Union[_models.CancellationReason, IO], - **kwargs: Any - ) -> None: - """Cancel order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param cancellation_reason: Reason for cancellation. Is either a CancellationReason type or a - IO type. Required. - :type cancellation_reason: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.CancellationReason - or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cancellation_reason, (IO, bytes)): - _content = cancellation_reason - else: - _json = self._serialize.body(cancellation_reason, "CancellationReason") - - request = build_cancel_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.cancel.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel" - } - - def _return_method_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - order_item_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(return_order_item_details, (IO, bytes)): - _content = return_order_item_details - else: - _json = self._serialize.body(return_order_item_details, "ReturnOrderItemDetails") - - request = build_return_method_request( - resource_group_name=resource_group_name, - order_item_name=order_item_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._return_method_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _return_method_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } - - @overload - def begin_return_method( - self, - resource_group_name: str, - order_item_name: str, - return_order_item_details: _models.ReturnOrderItemDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Return order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param return_order_item_details: Return order item details. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReturnOrderItemDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_return_method( - self, - resource_group_name: str, - order_item_name: str, - return_order_item_details: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Return order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param return_order_item_details: Return order item details. Required. - :type return_order_item_details: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_return_method( - self, - resource_group_name: str, - order_item_name: str, - return_order_item_details: Union[_models.ReturnOrderItemDetails, IO], - **kwargs: Any - ) -> LROPoller[None]: - """Return order item. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param order_item_name: The name of the order item. Required. - :type order_item_name: str - :param return_order_item_details: Return order item details. Is either a ReturnOrderItemDetails - type or a IO type. Required. - :type return_order_item_details: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ReturnOrderItemDetails or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._return_method_initial( # type: ignore - resource_group_name=resource_group_name, - order_item_name=order_item_name, - return_order_item_details=return_order_item_details, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - begin_return_method.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_orders_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_orders_operations.py deleted file mode 100644 index e83600d3f071..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_orders_operations.py +++ /dev/null @@ -1,431 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_request( - subscription_id: str, *, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, location: str, order_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "orderName": _SERIALIZER.url("order_name", order_name, "str"), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request( - resource_group_name: str, - subscription_id: str, - *, - skip_token: Optional[str] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class OrdersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s - :attr:`orders` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription( - self, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.OrderResource"]: - """List orders at subscription level. - - :param skip_token: $skipToken is supported on Get list of orders, which provides the next page - in the list of orders. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders"} - - @distributed_trace - def get(self, resource_group_name: str, location: str, order_name: str, **kwargs: Any) -> _models.OrderResource: - """Get an order. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param location: The name of Azure region. Required. - :type location: str - :param order_name: The name of the order. Required. - :type order_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrderResource or the result of cls(response) - :rtype: ~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderResource] = kwargs.pop("cls", None) - - request = build_get_request( - resource_group_name=resource_group_name, - location=location, - order_name=order_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OrderResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}" - } - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, skip_token: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.OrderResource"]: - """List orders at resource group level. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param skip_token: $skipToken is supported on Get list of orders, which provides the next page - in the list of orders. Default value is None. - :type skip_token: str - :param top: $top is supported on fetching list of resources. $top=10 means that the first 10 - items in the list will be returned to the API caller. Default value is None. - :type top: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrderResource or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.OrderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.OrderResourceList] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - top=top, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderResourceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_patch.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_patch.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_products_and_configurations_operations.py b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_products_and_configurations_operations.py deleted file mode 100644 index af5a3a6ed1ae..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/operations/_products_and_configurations_operations.py +++ /dev/null @@ -1,603 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section - -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_configurations_request( - subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_product_families_request( - subscription_id: str, *, expand: Optional[str] = None, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_product_families_metadata_request( - subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ProductsAndConfigurationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.edgeorder.v2022_05_01_preview.EdgeOrderManagementClient`'s - :attr:`products_and_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def list_configurations( - self, - configurations_request: _models.ConfigurationsRequest, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.Configuration"]: - """List configurations for the given product family, product line and product for the given - subscription. - - :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationsRequest - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_configurations( - self, - configurations_request: IO, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.Configuration"]: - """List configurations for the given product family, product line and product for the given - subscription. - - :param configurations_request: Filters for showing the configurations. Required. - :type configurations_request: IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_configurations( - self, - configurations_request: Union[_models.ConfigurationsRequest, IO], - skip_token: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.Configuration"]: - """List configurations for the given product family, product line and product for the given - subscription. - - :param configurations_request: Filters for showing the configurations. Is either a - ConfigurationsRequest type or a IO type. Required. - :type configurations_request: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ConfigurationsRequest or IO - :param skip_token: $skipToken is supported on list of configurations, which provides the next - page in the list of configurations. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either Configuration or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.Configuration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Configurations] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(configurations_request, (IO, bytes)): - _content = configurations_request - else: - _json = self._serialize.body(configurations_request, "ConfigurationsRequest") - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_configurations_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_configurations.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("Configurations", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_configurations.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations" - } - - @overload - def list_product_families( - self, - product_families_request: _models.ProductFamiliesRequest, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.ProductFamily"]: - """List product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesRequest - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_product_families( - self, - product_families_request: IO, - expand: Optional[str] = None, - skip_token: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Iterable["_models.ProductFamily"]: - """List product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Required. - :type product_families_request: IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_product_families( - self, - product_families_request: Union[_models.ProductFamiliesRequest, IO], - expand: Optional[str] = None, - skip_token: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.ProductFamily"]: - """List product families for the given subscription. - - :param product_families_request: Filters for showing the product families. Is either a - ProductFamiliesRequest type or a IO type. Required. - :type product_families_request: - ~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesRequest or IO - :param expand: $expand is supported on configurations parameter for product, which provides - details on the configurations for the product. Default value is None. - :type expand: str - :param skip_token: $skipToken is supported on list of product families, which provides the next - page in the list of product families. Default value is None. - :type skip_token: str - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamily or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamily] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ProductFamilies] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(product_families_request, (IO, bytes)): - _content = product_families_request - else: - _json = self._serialize.body(product_families_request, "ProductFamiliesRequest") - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_product_families_request( - subscription_id=self._config.subscription_id, - expand=expand, - skip_token=skip_token, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self.list_product_families.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ProductFamilies", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_product_families.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies" - } - - @distributed_trace - def list_product_families_metadata( - self, skip_token: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.ProductFamiliesMetadataDetails"]: - """List product families metadata for the given subscription. - - :param skip_token: $skipToken is supported on list of product families metadata, which provides - the next page in the list of product families metadata. Default value is None. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProductFamiliesMetadataDetails or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.edgeorder.v2022_05_01_preview.models.ProductFamiliesMetadataDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) - cls: ClsType[_models.ProductFamiliesMetadata] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_product_families_metadata_request( - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - template_url=self.list_product_families_metadata.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ProductFamiliesMetadata", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - list_product_families_metadata.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata" - } diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/py.typed b/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2022_05_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/cancel_order_item.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/cancel_order_item.py index cf8b1b5f3484..a4750c91be8d 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ @@ -29,12 +30,11 @@ def main(): subscription_id="YourSubscriptionId", ) - response = client.cancel_order_item( + client.cancel_order_item( order_item_name="TestOrderItemName3", resource_group_name="YourResourceGroupName", cancellation_reason={"reason": "Order cancelled"}, ) - print(response) # x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/CancelOrderItem.json 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 19523c7cb4e7..49ccd2aac278 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_address.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/create_address.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 354dd0bda36c..db06228292e5 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 15cd02b0371d..b46f5823b729 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ @@ -29,11 +30,10 @@ def main(): subscription_id="YourSubscriptionId", ) - response = client.begin_delete_address_by_name( + client.begin_delete_address_by_name( address_name="TestAddressName1", resource_group_name="YourResourceGroupName", ).result() - print(response) # x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteAddressByName.json 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 9b29405633fa..e58f9397efb7 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ @@ -29,11 +30,10 @@ def main(): subscription_id="YourSubscriptionId", ) - response = client.begin_delete_order_item_by_name( + client.begin_delete_order_item_by_name( order_item_name="TestOrderItemName3", resource_group_name="YourResourceGroupName", ).result() - print(response) # x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/DeleteOrderItemByName.json 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 4ffa5b695fb2..b840f49ed598 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 558d98d8967e..a90f586ec7cf 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 b91576e83884..4e40069d6b83 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 1d0a54fe99a1..836564b56ac6 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 0f6865c4e1a5..b92994338c93 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 558a3084dda4..b3b33363334f 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_configurations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_configurations.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 19c8c2ac0f4c..1cb12208f727 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_operations.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/list_operations.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 a0386d1fd0fe..e4a5b595cd89 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 253845f86393..ba5a88c171e8 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 b2b69ae84dd4..a8b07983bfd1 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 fb2692c03362..63aa57d2d7a7 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 8a70b264279b..f50795ca837e 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 39a70da96e7a..819b90d502cd 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 b22feffabc4b..04ec971ac22c 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ @@ -29,12 +30,11 @@ def main(): subscription_id="YourSubscriptionId", ) - response = client.begin_return_order_item( + client.begin_return_order_item( order_item_name="TestOrderName4", resource_group_name="YourResourceGroupName", return_order_item_details={"returnReason": "Order returned"}, ).result() - print(response) # x-ms-original-file: specification/edgeorder/resource-manager/Microsoft.EdgeOrder/stable/2021-12-01/examples/ReturnOrderItem.json 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 0983f644776d..5b062f78f288 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_address.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_samples/update_address.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ 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 1cc1d10861d2..06492c46b840 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.edgeorder import EdgeOrderManagementClient """ diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/conftest.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/conftest.py new file mode 100644 index 000000000000..6437dcff6284 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/conftest.py @@ -0,0 +1,37 @@ +# 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 os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# aovid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + edgeordermanagement_subscription_id = os.environ.get( + "AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + edgeordermanagement_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + edgeordermanagement_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + edgeordermanagement_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=edgeordermanagement_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=edgeordermanagement_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=edgeordermanagement_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=edgeordermanagement_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") 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 new file mode 100644 index 000000000000..8749498417a5 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management.py @@ -0,0 +1,526 @@ +# 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_async.py b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_async.py new file mode 100644 index 000000000000..480370133205 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/generated_tests/test_edge_order_management_async.py @@ -0,0 +1,545 @@ +# 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/sdk_packaging.toml b/sdk/edgeorder/azure-mgmt-edgeorder/sdk_packaging.toml index f8ba1242f913..8f3ee155c64b 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/sdk_packaging.toml +++ b/sdk/edgeorder/azure-mgmt-edgeorder/sdk_packaging.toml @@ -3,6 +3,6 @@ package_name = "azure-mgmt-edgeorder" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Edge Order Management" package_doc_id = "" -is_stable = false +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 index bc17fd126b0d..54caf933f227 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/setup.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/setup.py @@ -1,10 +1,10 @@ #!/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 @@ -16,64 +16,68 @@ PACKAGE_PPRINT_NAME = "Edge Order Management" # a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace('-', '/') +package_folder_path = PACKAGE_NAME.replace("-", "/") # a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace('-', '.') +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) +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') + raise RuntimeError("Cannot find version information") -with open('README.md', encoding='utf-8') as f: +with open("README.md", encoding="utf-8") as f: readme = f.read() -with open('CHANGELOG.md', encoding='utf-8') as f: +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', + 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 :: 4 - Beta', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'License :: OSI Approved :: MIT License', + "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', - ]), + 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'], + "pytyped": ["py.typed"], }, install_requires=[ - "msrest>=0.7.1", - "azure-common~=1.1", - "azure-mgmt-core>=1.3.2,<2.0.0", - "typing-extensions>=4.3.0; python_version<'3.8.0'", + "isodate>=0.6.1", + "typing-extensions>=4.6.0", + "azure-common>=1.1", + "azure-mgmt-core>=1.3.2", ], - python_requires=">=3.7" + python_requires=">=3.8", ) From 6ed925da68f23bdba76ffa71031ad24e8a597154 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 Date: Wed, 30 Oct 2024 15:25:34 +0800 Subject: [PATCH 2/3] update-testcase --- .../azure-mgmt-edgeorder/CHANGELOG.md | 39 +------- .../azure-mgmt-edgeorder/dev_requirements.txt | 2 + .../azure-mgmt-edgeorder/tests/conftest.py | 37 ++++++++ .../test_edge_order_management_async_test.py | 88 +++++++++++++++++++ .../tests/test_edge_order_management_test.py | 87 ++++++++++++++++++ 5 files changed, 215 insertions(+), 38 deletions(-) create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/tests/conftest.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_async_test.py create mode 100644 sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_test.py diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md index dc7f59953bf4..670ebd1d84ec 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md +++ b/sdk/edgeorder/azure-mgmt-edgeorder/CHANGELOG.md @@ -2,46 +2,9 @@ ## 2.0.0 (2024-10-30) -### Features Added - - - Enum `LengthHeightUnit` added member `IN` - - Method `EdgeOrderManagementClient.begin_create_address` has a new overload `def begin_create_address(self: None, address_name: str, resource_group_name: str, address_resource: AddressResource, content_type: str)` - - Method `EdgeOrderManagementClient.begin_create_address` has a new overload `def begin_create_address(self: None, address_name: str, resource_group_name: str, address_resource: IO[bytes], content_type: str)` - - Method `EdgeOrderManagementClient.begin_create_order_item` has a new overload `def begin_create_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_resource: OrderItemResource, content_type: str)` - - Method `EdgeOrderManagementClient.begin_create_order_item` has a new overload `def begin_create_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_resource: IO[bytes], content_type: str)` - - Method `EdgeOrderManagementClient.begin_return_order_item` has a new overload `def begin_return_order_item(self: None, order_item_name: str, resource_group_name: str, return_order_item_details: ReturnOrderItemDetails, content_type: str)` - - Method `EdgeOrderManagementClient.begin_return_order_item` has a new overload `def begin_return_order_item(self: None, order_item_name: str, resource_group_name: str, return_order_item_details: IO[bytes], content_type: str)` - - Method `EdgeOrderManagementClient.begin_update_address` has a new overload `def begin_update_address(self: None, address_name: str, resource_group_name: str, address_update_parameter: AddressUpdateParameter, if_match: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClient.begin_update_address` has a new overload `def begin_update_address(self: None, address_name: str, resource_group_name: str, address_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClient.begin_update_order_item` has a new overload `def begin_update_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_update_parameter: OrderItemUpdateParameter, if_match: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClient.begin_update_order_item` has a new overload `def begin_update_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClient.cancel_order_item` has a new overload `def cancel_order_item(self: None, order_item_name: str, resource_group_name: str, cancellation_reason: CancellationReason, content_type: str)` - - Method `EdgeOrderManagementClient.cancel_order_item` has a new overload `def cancel_order_item(self: None, order_item_name: str, resource_group_name: str, cancellation_reason: IO[bytes], content_type: str)` - - Method `EdgeOrderManagementClient.list_configurations` has a new overload `def list_configurations(self: None, configurations_request: ConfigurationsRequest, skip_token: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClient.list_configurations` has a new overload `def list_configurations(self: None, configurations_request: IO[bytes], skip_token: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClient.list_product_families` has a new overload `def list_product_families(self: None, product_families_request: ProductFamiliesRequest, expand: Optional[str], skip_token: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClient.list_product_families` has a new overload `def list_product_families(self: None, product_families_request: IO[bytes], expand: Optional[str], skip_token: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_create_address` has a new overload `def begin_create_address(self: None, address_name: str, resource_group_name: str, address_resource: AddressResource, content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_create_address` has a new overload `def begin_create_address(self: None, address_name: str, resource_group_name: str, address_resource: IO[bytes], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_create_order_item` has a new overload `def begin_create_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_resource: OrderItemResource, content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_create_order_item` has a new overload `def begin_create_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_resource: IO[bytes], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_return_order_item` has a new overload `def begin_return_order_item(self: None, order_item_name: str, resource_group_name: str, return_order_item_details: ReturnOrderItemDetails, content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_return_order_item` has a new overload `def begin_return_order_item(self: None, order_item_name: str, resource_group_name: str, return_order_item_details: IO[bytes], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_update_address` has a new overload `def begin_update_address(self: None, address_name: str, resource_group_name: str, address_update_parameter: AddressUpdateParameter, if_match: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_update_address` has a new overload `def begin_update_address(self: None, address_name: str, resource_group_name: str, address_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_update_order_item` has a new overload `def begin_update_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_update_parameter: OrderItemUpdateParameter, if_match: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.begin_update_order_item` has a new overload `def begin_update_order_item(self: None, order_item_name: str, resource_group_name: str, order_item_update_parameter: IO[bytes], if_match: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.cancel_order_item` has a new overload `def cancel_order_item(self: None, order_item_name: str, resource_group_name: str, cancellation_reason: CancellationReason, content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.cancel_order_item` has a new overload `def cancel_order_item(self: None, order_item_name: str, resource_group_name: str, cancellation_reason: IO[bytes], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.list_configurations` has a new overload `def list_configurations(self: None, configurations_request: ConfigurationsRequest, skip_token: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.list_configurations` has a new overload `def list_configurations(self: None, configurations_request: IO[bytes], skip_token: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.list_product_families` has a new overload `def list_product_families(self: None, product_families_request: ProductFamiliesRequest, expand: Optional[str], skip_token: Optional[str], content_type: str)` - - Method `EdgeOrderManagementClientOperationsMixin.list_product_families` has a new overload `def list_product_families(self: None, product_families_request: IO[bytes], expand: Optional[str], skip_token: Optional[str], content_type: str)` - ### Breaking Changes - - Method `EdgeOrderManagementClient.__init__` parameter `base_url` changed default value from `None` to `str` - - Deleted or renamed enum value `LengthHeightUnit.IN_ENUM` + - This package now only targets the latest Api-Version available on Azure and removes APIs of other Api-Version. After this change, the package can have much smaller size. If your application requires a specific and non-latest Api-Version, it's recommended to pin this package to the previous released version; If your application always only use latest Api-Version, please ingore this change. ## 2.0.0b1 (2023-02-13) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/dev_requirements.txt b/sdk/edgeorder/azure-mgmt-edgeorder/dev_requirements.txt index 6ccb7f031ddd..8bf78f8c9ae8 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/dev_requirements.txt +++ b/sdk/edgeorder/azure-mgmt-edgeorder/dev_requirements.txt @@ -1 +1,3 @@ -e ../../../tools/azure-sdk-tools +-e ../../resources/azure-mgmt-resource +aiohttp diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/tests/conftest.py b/sdk/edgeorder/azure-mgmt-edgeorder/tests/conftest.py new file mode 100644 index 000000000000..6437dcff6284 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/tests/conftest.py @@ -0,0 +1,37 @@ +# 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 os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# aovid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + edgeordermanagement_subscription_id = os.environ.get( + "AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + edgeordermanagement_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + edgeordermanagement_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + edgeordermanagement_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=edgeordermanagement_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=edgeordermanagement_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=edgeordermanagement_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=edgeordermanagement_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_async_test.py b/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_async_test.py new file mode 100644 index 000000000000..0d700a2045af --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_async_test.py @@ -0,0 +1,88 @@ +# 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.live_test_only +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() + result = [r async for r in response] + assert result + + + @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() + result = [r async for r in response] + assert response + + @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() + result = [r async for r in response] + assert response + + + @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() + result = [r async for r in response] + assert response + + + @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() + result = [r async for r in response] + assert response + + + @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, + ) + result = [r async for r in response] + assert result == [] + + @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, + ) + result = [r async for r in response] + assert result == [] + + + @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, + ) + result = [r async for r in response] + assert result == [] + \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_test.py b/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_test.py new file mode 100644 index 000000000000..7bfaadcaacc3 --- /dev/null +++ b/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_test.py @@ -0,0 +1,87 @@ +# 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.live_test_only +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() + result = [r for r in response] + assert response + + + @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() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list_product_families_metadata(self, resource_group): + response = self.client.list_product_families_metadata() + result = [r for r in response] + assert response + + + @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() + result = [r for r in response] + assert response + + + @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() + result = [r for r in response] + assert response + + + @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, + ) + result = [r for r in response] + assert result == [] + + @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, + ) + result = [r for r in response] + assert result == [] + + + @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, + ) + result = [r for r in response] + assert response + From f092d8336f5c248aa7fe42b218c438b5e3a3ab11 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 Date: Wed, 30 Oct 2024 15:27:31 +0800 Subject: [PATCH 3/3] update-testcases --- sdk/edgeorder/azure-mgmt-edgeorder/setup.py | 8 +++++--- .../tests/test_edge_order_management_async_test.py | 8 +------- .../tests/test_edge_order_management_test.py | 10 ++-------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/setup.py b/sdk/edgeorder/azure-mgmt-edgeorder/setup.py index 54caf933f227..d8e8e20c30f7 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/setup.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/setup.py @@ -22,9 +22,11 @@ # 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"), + ( + 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) diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_async_test.py b/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_async_test.py index 0d700a2045af..72e56baba273 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_async_test.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_async_test.py @@ -25,7 +25,6 @@ async def test_list_operations(self, resource_group): response = self.client.list_operations() result = [r async for r in response] assert result - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +39,6 @@ async def test_list_product_families_metadata(self, resource_group): response = self.client.list_product_families_metadata() result = [r async for r in response] assert response - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -48,7 +46,6 @@ async def test_list_order_at_subscription_level(self, resource_group): response = self.client.list_order_at_subscription_level() result = [r async for r in response] assert response - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -56,7 +53,6 @@ async def test_list_order_items_at_subscription_level(self, resource_group): response = self.client.list_order_items_at_subscription_level() result = [r async for r in response] assert response - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -66,7 +62,7 @@ async def test_list_addresses_at_resource_group_level(self, resource_group): ) result = [r async for r in response] assert result == [] - + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_list_order_at_resource_group_level(self, resource_group): @@ -75,7 +71,6 @@ async def test_list_order_at_resource_group_level(self, resource_group): ) result = [r async for r in response] assert result == [] - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -85,4 +80,3 @@ async def test_list_order_items_at_resource_group_level(self, resource_group): ) result = [r async for r in response] assert result == [] - \ No newline at end of file diff --git a/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_test.py b/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_test.py index 7bfaadcaacc3..0e66df1e9e78 100644 --- a/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_test.py +++ b/sdk/edgeorder/azure-mgmt-edgeorder/tests/test_edge_order_management_test.py @@ -24,7 +24,6 @@ def test_list_operations(self, resource_group): response = self.client.list_operations() result = [r for r in response] assert response - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -32,14 +31,13 @@ def test_list_addresses_at_subscription_level(self, resource_group): response = self.client.list_addresses_at_subscription_level() result = [r for r in response] assert response - + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_list_product_families_metadata(self, resource_group): response = self.client.list_product_families_metadata() result = [r for r in response] assert response - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -47,7 +45,6 @@ def test_list_order_at_subscription_level(self, resource_group): response = self.client.list_order_at_subscription_level() result = [r for r in response] assert response - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -55,7 +52,6 @@ def test_list_order_items_at_subscription_level(self, resource_group): response = self.client.list_order_items_at_subscription_level() result = [r for r in response] assert response - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -65,7 +61,7 @@ def test_list_addresses_at_resource_group_level(self, resource_group): ) result = [r for r in response] assert result == [] - + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_list_order_at_resource_group_level(self, resource_group): @@ -74,7 +70,6 @@ def test_list_order_at_resource_group_level(self, resource_group): ) result = [r for r in response] assert result == [] - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -84,4 +79,3 @@ def test_list_order_items_at_resource_group_level(self, resource_group): ) result = [r for r in response] assert response -