From 528b5501a6d32df3a219571309d737687a2f5d21 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 4 Jul 2025 07:09:03 +0000 Subject: [PATCH 1/3] code and test --- .../azure-mgmt-databoxedge/CHANGELOG.md | 4 + .../azure-mgmt-databoxedge/MANIFEST.in | 1 - .../azure-mgmt-databoxedge/README.md | 6 +- .../{_meta.json => _metadata.json} | 6 +- .../azure/mgmt/databoxedge/__init__.py | 26 +- .../azure/mgmt/databoxedge/_configuration.py | 56 +- .../_data_box_edge_management_client.py | 524 +-- .../databoxedge/{v2019_08_01 => }/_patch.py | 9 +- .../_version.py => _utils/__init__.py} | 3 - .../serialization.py} | 177 +- .../azure/mgmt/databoxedge/_version.py | 2 +- .../azure/mgmt/databoxedge/aio/__init__.py | 23 +- .../mgmt/databoxedge/aio/_configuration.py | 56 +- .../aio/_data_box_edge_management_client.py | 525 +-- .../{v2019_08_01/models => aio}/_patch.py | 9 +- .../aio/operations/__init__.py | 0 .../aio/operations/_addons_operations.py | 70 +- .../aio/operations/_alerts_operations.py | 37 +- .../operations/_available_skus_operations.py | 35 +- .../_bandwidth_schedules_operations.py | 57 +- .../aio/operations/_containers_operations.py | 62 +- .../aio/operations/_devices_operations.py | 188 +- .../aio/operations/_jobs_operations.py | 26 +- .../_monitoring_config_operations.py | 70 +- .../aio/operations/_nodes_operations.py | 35 +- .../aio/operations/_operations.py | 33 +- .../_operations_status_operations.py | 26 +- .../aio/operations/_orders_operations.py | 76 +- .../aio/operations/_patch.py | 9 +- .../aio/operations/_roles_operations.py | 55 +- .../aio/operations/_shares_operations.py | 59 +- ..._storage_account_credentials_operations.py | 57 +- .../_storage_accounts_operations.py | 62 +- .../aio/operations/_triggers_operations.py | 55 +- .../aio/operations/_users_operations.py | 66 +- .../azure/mgmt/databoxedge/models.py | 7 - .../models/__init__.py | 0 .../_data_box_edge_management_client_enums.py | 0 .../models/_models_py3.py | 1267 +++--- .../{v2019_08_01/aio => models}/_patch.py | 9 +- .../operations/__init__.py | 0 .../operations/_addons_operations.py | 78 +- .../operations/_alerts_operations.py | 48 +- .../operations/_available_skus_operations.py | 38 +- .../_bandwidth_schedules_operations.py | 78 +- .../operations/_containers_operations.py | 82 +- .../operations/_devices_operations.py | 225 +- .../operations/_jobs_operations.py | 34 +- .../_monitoring_config_operations.py | 78 +- .../operations/_nodes_operations.py | 40 +- .../operations/_operations.py | 37 +- .../_operations_status_operations.py | 34 +- .../operations/_orders_operations.py | 86 +- .../mgmt/databoxedge/operations/_patch.py | 21 + .../operations/_roles_operations.py | 74 +- .../operations/_shares_operations.py | 82 +- ..._storage_account_credentials_operations.py | 81 +- .../_storage_accounts_operations.py | 81 +- .../operations/_triggers_operations.py | 74 +- .../operations/_users_operations.py | 91 +- .../mgmt/databoxedge/v2019_08_01/__init__.py | 32 - .../databoxedge/v2019_08_01/_configuration.py | 64 - .../_data_box_edge_management_client.py | 187 - .../databoxedge/v2019_08_01/_metadata.json | 125 - .../databoxedge/v2019_08_01/aio/__init__.py | 29 - .../v2019_08_01/aio/_configuration.py | 64 - .../aio/_data_box_edge_management_client.py | 189 - .../v2019_08_01/aio/operations/__init__.py | 55 - .../aio/operations/_devices_operations.py | 1521 ------- .../aio/operations/_nodes_operations.py | 139 - .../aio/operations/_orders_operations.py | 494 --- .../aio/operations/_skus_operations.py | 137 - .../v2019_08_01/models/__init__.py | 262 -- .../_data_box_edge_management_client_enums.py | 391 -- .../v2019_08_01/models/_models_py3.py | 3805 ----------------- .../v2019_08_01/operations/__init__.py | 55 - .../operations/_devices_operations.py | 1938 --------- .../operations/_nodes_operations.py | 172 - .../operations/_orders_operations.py | 615 --- .../v2019_08_01/operations/_patch.py | 20 - .../operations/_skus_operations.py | 166 - .../mgmt/databoxedge/v2019_08_01/py.typed | 1 - .../v2021_02_01_preview/__init__.py | 32 - .../v2021_02_01_preview/_configuration.py | 64 - .../_data_box_edge_management_client.py | 221 - .../v2021_02_01_preview/_metadata.json | 127 - .../databoxedge/v2021_02_01_preview/_patch.py | 20 - .../v2021_02_01_preview/_version.py | 9 - .../v2021_02_01_preview/aio/__init__.py | 29 - .../v2021_02_01_preview/aio/_configuration.py | 64 - .../aio/_data_box_edge_management_client.py | 224 - .../v2021_02_01_preview/aio/_patch.py | 20 - .../aio/operations/_alerts_operations.py | 203 - .../_bandwidth_schedules_operations.py | 534 --- .../aio/operations/_containers_operations.py | 684 --- .../aio/operations/_jobs_operations.py | 115 - .../aio/operations/_operations.py | 134 - .../_operations_status_operations.py | 115 - .../aio/operations/_patch.py | 20 - .../aio/operations/_roles_operations.py | 517 --- .../aio/operations/_shares_operations.py | 652 --- ..._storage_account_credentials_operations.py | 539 --- .../_storage_accounts_operations.py | 544 --- .../aio/operations/_triggers_operations.py | 534 --- .../aio/operations/_users_operations.py | 525 --- .../v2021_02_01_preview/models/_patch.py | 20 - .../operations/_alerts_operations.py | 267 -- .../_bandwidth_schedules_operations.py | 655 --- .../operations/_containers_operations.py | 864 ---- .../operations/_jobs_operations.py | 150 - .../operations/_operations.py | 156 - .../_operations_status_operations.py | 150 - .../v2021_02_01_preview/operations/_patch.py | 20 - .../operations/_roles_operations.py | 636 --- .../operations/_shares_operations.py | 798 ---- ..._storage_account_credentials_operations.py | 661 --- .../_storage_accounts_operations.py | 671 --- .../operations/_triggers_operations.py | 656 --- .../operations/_users_operations.py | 646 --- .../databoxedge/v2021_02_01_preview/py.typed | 1 - .../generated_samples/alert_get.py | 3 +- .../alert_get_all_in_device.py | 3 +- .../generated_samples/available_skus_list.py | 4 +- .../bandwidth_schedule_delete.py | 3 +- .../bandwidth_schedule_get.py | 3 +- .../bandwidth_schedule_get_all_in_device.py | 3 +- .../bandwidth_schedule_put.py | 3 +- .../generated_samples/container_delete.py | 3 +- .../generated_samples/container_get.py | 3 +- .../container_list_all_in_device.py | 3 +- .../generated_samples/container_put.py | 3 +- .../generated_samples/container_refresh.py | 3 +- .../data_box_edge_device_delete.py | 3 +- .../data_box_edge_device_get_by_name.py | 3 +- ..._device_get_by_name_with_data_residency.py | 41 - ...a_box_edge_device_get_by_resource_group.py | 3 +- ...ata_box_edge_device_get_by_subscription.py | 3 +- .../data_box_edge_device_patch.py | 13 +- .../data_box_edge_device_put.py | 8 +- ...box_edge_device_put_with_data_residency.py | 47 - .../generated_samples/delete_addons.py | 7 +- .../delete_monitoring_config.py | 7 +- .../generated_samples/device_capacity_get.py | 41 - .../device_capacity_request_post.py | 42 - .../download_updates_post.py | 3 +- .../generated_samples/extended_info_post.py | 3 +- .../generated_samples/generate_certificate.py | 4 +- .../generated_samples/get_addons.py | 4 +- .../generated_samples/get_dc_access_code.py | 4 +- ...ostic_proactive_log_collection_settings.py | 41 - .../get_diagnostic_remote_support_settings.py | 41 - .../get_monitoring_config.py | 4 +- .../generated_samples/install_updates_post.py | 3 +- .../generated_samples/jobs_get.py | 3 +- .../list_monitoring_config.py | 4 +- .../generated_samples/list_skus.py | 40 - .../generated_samples/network_settings_get.py | 3 +- .../node_get_all_in_device.py | 3 +- .../generated_samples/operations_get.py | 3 +- .../operations_status_get.py | 3 +- .../generated_samples/order_delete.py | 3 +- .../generated_samples/order_get.py | 3 +- .../order_get_all_in_device.py | 3 +- .../generated_samples/order_put.py | 3 +- .../generated_samples/put_addons.py | 4 +- .../put_monitoring_config.py | 4 +- .../generated_samples/role_delete.py | 3 +- .../generated_samples/role_get.py | 3 +- .../role_get_all_in_device.py | 3 +- .../generated_samples/role_list_add_ons.py | 4 +- .../generated_samples/role_put.py | 3 +- .../generated_samples/sac_delete.py | 3 +- .../generated_samples/sac_get.py | 3 +- .../sac_get_all_in_device.py | 3 +- .../generated_samples/sac_put.py | 3 +- .../scan_for_updates_post.py | 3 +- .../security_settings_update_post.py | 7 +- .../generated_samples/share_delete.py | 3 +- .../generated_samples/share_get.py | 3 +- .../share_get_all_in_device.py | 3 +- .../generated_samples/share_put.py | 3 +- .../generated_samples/share_refresh_post.py | 3 +- .../storage_account_delete.py | 3 +- .../generated_samples/storage_account_get.py | 3 +- .../storage_account_get_all_in_device.py | 3 +- .../generated_samples/storage_account_put.py | 3 +- .../generated_samples/trigger_delete.py | 3 +- .../generated_samples/trigger_get.py | 3 +- .../trigger_get_all_in_device.py | 3 +- .../generated_samples/trigger_put.py | 3 +- .../trigger_support_package.py | 48 - ...ostic_proactive_log_collection_settings.py | 42 - ...date_diagnostic_remote_support_settings.py | 52 - .../generated_samples/update_summary_get.py | 3 +- .../upload_certificate_post.py | 3 +- .../generated_samples/user_delete.py | 3 +- .../generated_samples/user_get.py | 3 +- .../user_get_all_in_device.py | 3 +- .../generated_samples/user_put.py | 4 +- ...a_box_edge_management_addons_operations.py | 96 + ...edge_management_addons_operations_async.py | 101 + ...a_box_edge_management_alerts_operations.py | 4 +- ...edge_management_alerts_operations_async.py | 4 +- ...ge_management_available_skus_operations.py | 29 + ...agement_available_skus_operations_async.py | 30 + ...nagement_bandwidth_schedules_operations.py | 16 +- ...nt_bandwidth_schedules_operations_async.py | 16 +- ...x_edge_management_containers_operations.py | 18 +- ..._management_containers_operations_async.py | 18 +- ..._box_edge_management_devices_operations.py | 93 +- ...dge_management_devices_operations_async.py | 93 +- ...ata_box_edge_management_jobs_operations.py | 2 +- ...x_edge_management_jobs_operations_async.py | 2 +- ...management_monitoring_config_operations.py | 103 + ...ment_monitoring_config_operations_async.py | 108 + ...ta_box_edge_management_nodes_operations.py | 2 +- ..._edge_management_nodes_operations_async.py | 2 +- ...est_data_box_edge_management_operations.py | 2 +- ...ta_box_edge_management_operations_async.py | 2 +- ...management_operations_status_operations.py | 2 +- ...ment_operations_status_operations_async.py | 2 +- ...a_box_edge_management_orders_operations.py | 47 +- ...edge_management_orders_operations_async.py | 47 +- ...ta_box_edge_management_roles_operations.py | 63 +- ..._edge_management_roles_operations_async.py | 63 +- ...a_box_edge_management_shares_operations.py | 22 +- ...edge_management_shares_operations_async.py | 22 +- ..._storage_account_credentials_operations.py | 16 +- ...ge_account_credentials_operations_async.py | 16 +- ..._management_storage_accounts_operations.py | 18 +- ...ement_storage_accounts_operations_async.py | 18 +- ...box_edge_management_triggers_operations.py | 16 +- ...ge_management_triggers_operations_async.py | 16 +- ...ta_box_edge_management_users_operations.py | 18 +- ..._edge_management_users_operations_async.py | 18 +- .../azure-mgmt-databoxedge/sdk_packaging.toml | 2 +- .../azure-mgmt-databoxedge/setup.py | 7 +- 237 files changed, 3249 insertions(+), 26472 deletions(-) rename sdk/databoxedge/azure-mgmt-databoxedge/{_meta.json => _metadata.json} (59%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/_patch.py (61%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01/_version.py => _utils/__init__.py} (93%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{_serialization.py => _utils/serialization.py} (94%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01/models => aio}/_patch.py (61%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/aio/operations/__init__.py (100%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/aio/operations/_addons_operations.py (89%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_alerts_operations.py (86%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/aio/operations/_available_skus_operations.py (79%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_bandwidth_schedules_operations.py (91%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_containers_operations.py (93%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/aio/operations/_devices_operations.py (90%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_jobs_operations.py (82%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/aio/operations/_monitoring_config_operations.py (89%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/aio/operations/_nodes_operations.py (81%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_operations.py (80%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_operations_status_operations.py (82%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/aio/operations/_orders_operations.py (88%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_patch.py (61%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_roles_operations.py (92%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_shares_operations.py (93%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_storage_account_credentials_operations.py (92%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_storage_accounts_operations.py (90%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_triggers_operations.py (92%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/aio/operations/_users_operations.py (91%) delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models.py rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/models/__init__.py (100%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/models/_data_box_edge_management_client_enums.py (100%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/models/_models_py3.py (83%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01/aio => models}/_patch.py (61%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/operations/__init__.py (100%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/operations/_addons_operations.py (91%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_alerts_operations.py (88%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/operations/_available_skus_operations.py (81%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_bandwidth_schedules_operations.py (91%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_containers_operations.py (94%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/operations/_devices_operations.py (91%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_jobs_operations.py (84%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/operations/_monitoring_config_operations.py (90%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/operations/_nodes_operations.py (84%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_operations.py (82%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_operations_status_operations.py (84%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2021_02_01_preview => }/operations/_orders_operations.py (91%) create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_patch.py rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_roles_operations.py (93%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_shares_operations.py (93%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_storage_account_credentials_operations.py (91%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_storage_accounts_operations.py (91%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_triggers_operations.py (93%) rename sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/{v2019_08_01 => }/operations/_users_operations.py (91%) delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/__init__.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_configuration.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_data_box_edge_management_client.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_metadata.json delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/__init__.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_configuration.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_data_box_edge_management_client.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/__init__.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_devices_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_nodes_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_orders_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_skus_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/__init__.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_data_box_edge_management_client_enums.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models_py3.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/__init__.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_devices_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_nodes_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_orders_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_patch.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_skus_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/py.typed delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/__init__.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_configuration.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_data_box_edge_management_client.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_metadata.json delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_patch.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_version.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/__init__.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_configuration.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_data_box_edge_management_client.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_patch.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_alerts_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_bandwidth_schedules_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_containers_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_jobs_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations_status_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_patch.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_roles_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_shares_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_account_credentials_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_accounts_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_triggers_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_users_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_patch.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_alerts_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_bandwidth_schedules_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_containers_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_jobs_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations_status_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_patch.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_roles_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_shares_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_account_credentials_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_accounts_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_triggers_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_users_operations.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/py.typed delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_name_with_data_residency.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_put_with_data_residency.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/device_capacity_get.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/device_capacity_request_post.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_diagnostic_proactive_log_collection_settings.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_diagnostic_remote_support_settings.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/list_skus.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_support_package.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_diagnostic_proactive_log_collection_settings.py delete mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_diagnostic_remote_support_settings.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_addons_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_addons_operations_async.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_available_skus_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_available_skus_operations_async.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_monitoring_config_operations.py create mode 100644 sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_monitoring_config_operations_async.py diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/CHANGELOG.md b/sdk/databoxedge/azure-mgmt-databoxedge/CHANGELOG.md index 105cd7405dbc..fd6056a9cacc 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/CHANGELOG.md +++ b/sdk/databoxedge/azure-mgmt-databoxedge/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 0.0.0(it should be perview) (2025-07-21) + + + ## 2.0.0 (2025-02-19) ### Features Added diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/MANIFEST.in b/sdk/databoxedge/azure-mgmt-databoxedge/MANIFEST.in index 2362abaee6b3..0567a523a7a4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/MANIFEST.in +++ b/sdk/databoxedge/azure-mgmt-databoxedge/MANIFEST.in @@ -1,4 +1,3 @@ -include _meta.json recursive-include tests *.py *.json recursive-include samples *.py *.md include *.md diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/README.md b/sdk/databoxedge/azure-mgmt-databoxedge/README.md index 5ff167b36ca6..9391031556c4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/README.md +++ b/sdk/databoxedge/azure-mgmt-databoxedge/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Data Box Edge Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/_meta.json b/sdk/databoxedge/azure-mgmt-databoxedge/_metadata.json similarity index 59% rename from sdk/databoxedge/azure-mgmt-databoxedge/_meta.json rename to sdk/databoxedge/azure-mgmt-databoxedge/_metadata.json index a74404688b45..d96a2a6e77df 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/_meta.json +++ b/sdk/databoxedge/azure-mgmt-databoxedge/_metadata.json @@ -1,11 +1,11 @@ { - "commit": "eda4ed64f1ba48ebc65539f0a23baeb2114c98bf", + "commit": "f5911db2618814efff4b2579fe9a43ab53f4cf4f", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.27.4", + "@autorest/python@6.35.0", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/databoxedge/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 --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/databoxedge/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-02-01-preview --use=@autorest/python@6.35.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/databoxedge/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/__init__.py index daee29a5a3fe..0bedbc7bb26e 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/__init__.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/__init__.py @@ -5,16 +5,28 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._data_box_edge_management_client import DataBoxEdgeManagementClient -__all__ = ['DataBoxEdgeManagementClient'] +from typing import TYPE_CHECKING -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import +from ._data_box_edge_management_client import DataBoxEdgeManagementClient # type: ignore from ._version import VERSION __version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "DataBoxEdgeManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_configuration.py index f7a07b280ada..57e36b7f5023 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_configuration.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_configuration.py @@ -1,13 +1,11 @@ # 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.pipeline import policies @@ -16,10 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class DataBoxEdgeManagementClientConfiguration: + +class DataBoxEdgeManagementClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for DataBoxEdgeManagementClient. Note that all parameters used to create this instance are saved as instance @@ -29,14 +27,14 @@ class DataBoxEdgeManagementClientConfiguration: :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-02-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 - ): + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2021-02-01-preview") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -44,23 +42,23 @@ def __init__( 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-databoxedge/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-databoxedge/{}".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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py index b881c0ff37ba..f486c2d73a49 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py @@ -1,82 +1,115 @@ # 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, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin +from azure.mgmt.core.tools import get_arm_endpoints +from . import models as _models from ._configuration import DataBoxEdgeManagementClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer +from .operations import ( + AddonsOperations, + AlertsOperations, + AvailableSkusOperations, + BandwidthSchedulesOperations, + ContainersOperations, + DevicesOperations, + JobsOperations, + MonitoringConfigOperations, + NodesOperations, + Operations, + OperationsStatusOperations, + OrdersOperations, + RolesOperations, + SharesOperations, + StorageAccountCredentialsOperations, + StorageAccountsOperations, + TriggersOperations, + UsersOperations, +) 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 DataBoxEdgeManagementClient(MultiApiClientMixin, _SDKClient): - """The DataBoxEdge 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. +class DataBoxEdgeManagementClient: # pylint: disable=too-many-instance-attributes + """DataBoxEdgeManagementClient. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: azure.mgmt.databoxedge.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: + azure.mgmt.databoxedge.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.operations.UsersOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID. Required. :type subscription_id: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param base_url: Service URL + :param base_url: Service URL. Default value is None. :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-02-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. """ - DEFAULT_API_VERSION = '2019-08-01' - _PROFILE_TAG = "azure.mgmt.databoxedge.DataBoxEdgeManagementClient" - 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 - ): - if api_version: - kwargs.setdefault('api_version', api_version) - self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = DataBoxEdgeManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs + ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -95,346 +128,69 @@ def __init__( 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) - super(DataBoxEdgeManagementClient, self).__init__( - api_version=api_version, - profile=profile + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, 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 + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.available_skus = AvailableSkusOperations(self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize ) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations(self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.shares = SharesOperations(self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.containers = ContainersOperations(self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations(self._client, self._config, self._serialize, self._deserialize) - @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: - - * 2019-08-01: :mod:`v2019_08_01.models` - * 2021-02-01-preview: :mod:`v2021_02_01_preview.models` - """ - if api_version == '2019-08-01': - from .v2019_08_01 import models - return models - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def addons(self): - """Instance depends on the API version: - - * 2021-02-01-preview: :class:`AddonsOperations` - """ - api_version = self._get_api_version('addons') - if api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import AddonsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'addons'".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)), api_version) - - @property - def alerts(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`AlertsOperations` - * 2021-02-01-preview: :class:`AlertsOperations` - """ - api_version = self._get_api_version('alerts') - if api_version == '2019-08-01': - from .v2019_08_01.operations import AlertsOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import AlertsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'alerts'".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)), api_version) - - @property - def available_skus(self): - """Instance depends on the API version: - - * 2021-02-01-preview: :class:`AvailableSkusOperations` - """ - api_version = self._get_api_version('available_skus') - if api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import AvailableSkusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'available_skus'".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)), api_version) - - @property - def bandwidth_schedules(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`BandwidthSchedulesOperations` - * 2021-02-01-preview: :class:`BandwidthSchedulesOperations` - """ - api_version = self._get_api_version('bandwidth_schedules') - if api_version == '2019-08-01': - from .v2019_08_01.operations import BandwidthSchedulesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import BandwidthSchedulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'bandwidth_schedules'".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)), api_version) - - @property - def containers(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`ContainersOperations` - * 2021-02-01-preview: :class:`ContainersOperations` - """ - api_version = self._get_api_version('containers') - if api_version == '2019-08-01': - from .v2019_08_01.operations import ContainersOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import ContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'containers'".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)), api_version) - - @property - def devices(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`DevicesOperations` - * 2021-02-01-preview: :class:`DevicesOperations` - """ - api_version = self._get_api_version('devices') - if api_version == '2019-08-01': - from .v2019_08_01.operations import DevicesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import DevicesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'devices'".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)), api_version) - - @property - def jobs(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`JobsOperations` - * 2021-02-01-preview: :class:`JobsOperations` - """ - api_version = self._get_api_version('jobs') - if api_version == '2019-08-01': - from .v2019_08_01.operations import JobsOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import JobsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) - - @property - def monitoring_config(self): - """Instance depends on the API version: - - * 2021-02-01-preview: :class:`MonitoringConfigOperations` - """ - api_version = self._get_api_version('monitoring_config') - if api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import MonitoringConfigOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'monitoring_config'".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)), api_version) - - @property - def nodes(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`NodesOperations` - * 2021-02-01-preview: :class:`NodesOperations` - """ - api_version = self._get_api_version('nodes') - if api_version == '2019-08-01': - from .v2019_08_01.operations import NodesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import NodesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'nodes'".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)), api_version) - - @property - def operations(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`Operations` - * 2021-02-01-preview: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2019-08-01': - from .v2019_08_01.operations import Operations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_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)), api_version) - - @property - def operations_status(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`OperationsStatusOperations` - * 2021-02-01-preview: :class:`OperationsStatusOperations` - """ - api_version = self._get_api_version('operations_status') - if api_version == '2019-08-01': - from .v2019_08_01.operations import OperationsStatusOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import OperationsStatusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations_status'".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)), api_version) - - @property - def orders(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`OrdersOperations` - * 2021-02-01-preview: :class:`OrdersOperations` - """ - api_version = self._get_api_version('orders') - if api_version == '2019-08-01': - from .v2019_08_01.operations import OrdersOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_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)), api_version) - - @property - def roles(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`RolesOperations` - * 2021-02-01-preview: :class:`RolesOperations` - """ - api_version = self._get_api_version('roles') - if api_version == '2019-08-01': - from .v2019_08_01.operations import RolesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import RolesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'roles'".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)), api_version) - - @property - def shares(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`SharesOperations` - * 2021-02-01-preview: :class:`SharesOperations` - """ - api_version = self._get_api_version('shares') - if api_version == '2019-08-01': - from .v2019_08_01.operations import SharesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import SharesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'shares'".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)), api_version) - - @property - def skus(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`SkusOperations` - """ - api_version = self._get_api_version('skus') - if api_version == '2019-08-01': - from .v2019_08_01.operations import SkusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'skus'".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)), api_version) - - @property - def storage_account_credentials(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`StorageAccountCredentialsOperations` - * 2021-02-01-preview: :class:`StorageAccountCredentialsOperations` - """ - api_version = self._get_api_version('storage_account_credentials') - if api_version == '2019-08-01': - from .v2019_08_01.operations import StorageAccountCredentialsOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import StorageAccountCredentialsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'storage_account_credentials'".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)), api_version) - - @property - def storage_accounts(self): - """Instance depends on the API version: + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. - * 2019-08-01: :class:`StorageAccountsOperations` - * 2021-02-01-preview: :class:`StorageAccountsOperations` - """ - api_version = self._get_api_version('storage_accounts') - if api_version == '2019-08-01': - from .v2019_08_01.operations import StorageAccountsOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import StorageAccountsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'storage_accounts'".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)), api_version) + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + - @property - def triggers(self): - """Instance depends on the API version: + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - * 2019-08-01: :class:`TriggersOperations` - * 2021-02-01-preview: :class:`TriggersOperations` + :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 """ - api_version = self._get_api_version('triggers') - if api_version == '2019-08-01': - from .v2019_08_01.operations import TriggersOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import TriggersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'triggers'".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)), api_version) - @property - def users(self): - """Instance depends on the API version: + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - * 2019-08-01: :class:`UsersOperations` - * 2021-02-01-preview: :class:`UsersOperations` - """ - api_version = self._get_api_version('users') - if api_version == '2019-08-01': - from .v2019_08_01.operations import UsersOperations as OperationClass - elif api_version == '2021-02-01-preview': - from .v2021_02_01_preview.operations import UsersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'users'".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)), 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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_patch.py similarity index 61% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_patch.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_patch.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_version.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_utils/__init__.py similarity index 93% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_version.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_utils/__init__.py index 48944bf3938a..0af9b28f6607 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_version.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_utils/__init__.py @@ -1,9 +1,6 @@ -# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- - -VERSION = "2.0.0" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_serialization.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_utils/serialization.py similarity index 94% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_serialization.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_utils/serialization.py index a94487cbf17a..f5187701d7be 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_serialization.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_utils/serialization.py @@ -1,27 +1,10 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false @@ -47,9 +30,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, ) @@ -60,13 +41,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -184,73 +165,7 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0. - - :param datetime.datetime dt: The datetime - :returns: The offset - :rtype: datetime.timedelta - """ - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation. - - :param datetime.datetime dt: The datetime - :returns: The timestamp representation - :rtype: str - """ - return "Z" - - def dst(self, dt): - """No daylight saving for UTC. - - :param datetime.datetime dt: The datetime - :returns: The daylight saving time - :rtype: datetime.timedelta - """ - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset) -> None: - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -478,8 +393,8 @@ def from_dict( :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -625,7 +540,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) @@ -735,8 +650,8 @@ def body(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized request body """ @@ -780,8 +695,8 @@ def url(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -804,8 +719,8 @@ def query(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized query parameter """ try: @@ -834,8 +749,8 @@ def header(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None :returns: The serialized header """ try: @@ -854,9 +769,9 @@ def serialize_data(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list """ @@ -1191,7 +1106,7 @@ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. :return: serialized rfc """ try: @@ -1217,7 +1132,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. :return: serialized iso """ if isinstance(attr, str): @@ -1250,7 +1165,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid :return: serialied unix """ if isinstance(attr, int): @@ -1428,7 +1343,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument # Iter and wrapped, should have found one node only (the wrap one) if len(children) != 1: raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name ) ) @@ -1487,7 +1402,7 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1501,7 +1416,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1716,7 +1631,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return- :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. :rtype: object """ @@ -1798,7 +1713,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1844,7 +1759,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1935,7 +1850,7 @@ def deserialize_bytearray(attr): :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1948,7 +1863,7 @@ def deserialize_base64(attr): :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1963,7 +1878,7 @@ def deserialize_decimal(attr): :param str attr: response string to be deserialized. :return: Deserialized decimal - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): @@ -1981,7 +1896,7 @@ def deserialize_long(attr): :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1994,7 +1909,7 @@ def deserialize_duration(attr): :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2012,7 +1927,7 @@ def deserialize_date(attr): :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2028,7 +1943,7 @@ def deserialize_time(attr): :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2043,14 +1958,14 @@ def deserialize_rfc(attr): :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) @@ -2066,7 +1981,7 @@ def deserialize_iso(attr): :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -2104,7 +2019,7 @@ def deserialize_unix(attr): :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_version.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_version.py index 88729157c488..fb6c13e9c00f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_version.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "0.0.0" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/__init__.py index c33d46ee91d8..c86847aa9e87 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/__init__.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/__init__.py @@ -5,6 +5,25 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._data_box_edge_management_client import DataBoxEdgeManagementClient -__all__ = ['DataBoxEdgeManagementClient'] +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._data_box_edge_management_client import DataBoxEdgeManagementClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "DataBoxEdgeManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_configuration.py index 1a82b94a5109..444bce0d903c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_configuration.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_configuration.py @@ -1,13 +1,11 @@ # 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.pipeline import policies @@ -16,10 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class DataBoxEdgeManagementClientConfiguration: + +class DataBoxEdgeManagementClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for DataBoxEdgeManagementClient. Note that all parameters used to create this instance are saved as instance @@ -29,14 +27,14 @@ class DataBoxEdgeManagementClientConfiguration: :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-02-01-preview". Note that overriding + this default value may result in unsupported behavior. + :paramtype api_version: str """ - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2021-02-01-preview") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -44,23 +42,23 @@ def __init__( 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-databoxedge/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-databoxedge/{}".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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_data_box_edge_management_client.py index 614fe5cc5201..52e89580c6cf 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_data_box_edge_management_client.py @@ -1,82 +1,116 @@ # 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, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin +from azure.mgmt.core.tools import get_arm_endpoints -from .._serialization import Deserializer, Serializer +from .. import models as _models +from .._utils.serialization import Deserializer, Serializer from ._configuration import DataBoxEdgeManagementClientConfiguration +from .operations import ( + AddonsOperations, + AlertsOperations, + AvailableSkusOperations, + BandwidthSchedulesOperations, + ContainersOperations, + DevicesOperations, + JobsOperations, + MonitoringConfigOperations, + NodesOperations, + Operations, + OperationsStatusOperations, + OrdersOperations, + RolesOperations, + SharesOperations, + StorageAccountCredentialsOperations, + StorageAccountsOperations, + TriggersOperations, + UsersOperations, +) 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 DataBoxEdgeManagementClient(MultiApiClientMixin, _SDKClient): - """The DataBoxEdge 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. +class DataBoxEdgeManagementClient: # pylint: disable=too-many-instance-attributes + """DataBoxEdgeManagementClient. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.databoxedge.aio.operations.Operations + :ivar available_skus: AvailableSkusOperations operations + :vartype available_skus: azure.mgmt.databoxedge.aio.operations.AvailableSkusOperations + :ivar devices: DevicesOperations operations + :vartype devices: azure.mgmt.databoxedge.aio.operations.DevicesOperations + :ivar alerts: AlertsOperations operations + :vartype alerts: azure.mgmt.databoxedge.aio.operations.AlertsOperations + :ivar bandwidth_schedules: BandwidthSchedulesOperations operations + :vartype bandwidth_schedules: + azure.mgmt.databoxedge.aio.operations.BandwidthSchedulesOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.databoxedge.aio.operations.JobsOperations + :ivar nodes: NodesOperations operations + :vartype nodes: azure.mgmt.databoxedge.aio.operations.NodesOperations + :ivar operations_status: OperationsStatusOperations operations + :vartype operations_status: azure.mgmt.databoxedge.aio.operations.OperationsStatusOperations + :ivar orders: OrdersOperations operations + :vartype orders: azure.mgmt.databoxedge.aio.operations.OrdersOperations + :ivar roles: RolesOperations operations + :vartype roles: azure.mgmt.databoxedge.aio.operations.RolesOperations + :ivar addons: AddonsOperations operations + :vartype addons: azure.mgmt.databoxedge.aio.operations.AddonsOperations + :ivar monitoring_config: MonitoringConfigOperations operations + :vartype monitoring_config: azure.mgmt.databoxedge.aio.operations.MonitoringConfigOperations + :ivar shares: SharesOperations operations + :vartype shares: azure.mgmt.databoxedge.aio.operations.SharesOperations + :ivar storage_account_credentials: StorageAccountCredentialsOperations operations + :vartype storage_account_credentials: + azure.mgmt.databoxedge.aio.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.databoxedge.aio.operations.StorageAccountsOperations + :ivar containers: ContainersOperations operations + :vartype containers: azure.mgmt.databoxedge.aio.operations.ContainersOperations + :ivar triggers: TriggersOperations operations + :vartype triggers: azure.mgmt.databoxedge.aio.operations.TriggersOperations + :ivar users: UsersOperations operations + :vartype users: azure.mgmt.databoxedge.aio.operations.UsersOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID. Required. :type subscription_id: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param base_url: Service URL + :param base_url: Service URL. Default value is None. :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-02-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. """ - DEFAULT_API_VERSION = '2019-08-01' - _PROFILE_TAG = "azure.mgmt.databoxedge.DataBoxEdgeManagementClient" - 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 + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: - if api_version: - kwargs.setdefault('api_version', api_version) - self._config = DataBoxEdgeManagementClientConfiguration(credential, subscription_id, **kwargs) + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = DataBoxEdgeManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs + ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -95,346 +129,73 @@ def __init__( 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) - super(DataBoxEdgeManagementClient, self).__init__( - api_version=api_version, - profile=profile + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs ) - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: - - * 2019-08-01: :mod:`v2019_08_01.models` - * 2021-02-01-preview: :mod:`v2021_02_01_preview.models` - """ - if api_version == '2019-08-01': - from ..v2019_08_01 import models - return models - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def addons(self): - """Instance depends on the API version: - - * 2021-02-01-preview: :class:`AddonsOperations` - """ - api_version = self._get_api_version('addons') - if api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import AddonsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'addons'".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)), api_version) - - @property - def alerts(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`AlertsOperations` - * 2021-02-01-preview: :class:`AlertsOperations` - """ - api_version = self._get_api_version('alerts') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import AlertsOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import AlertsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'alerts'".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)), api_version) - - @property - def available_skus(self): - """Instance depends on the API version: - - * 2021-02-01-preview: :class:`AvailableSkusOperations` - """ - api_version = self._get_api_version('available_skus') - if api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import AvailableSkusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'available_skus'".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)), api_version) - - @property - def bandwidth_schedules(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`BandwidthSchedulesOperations` - * 2021-02-01-preview: :class:`BandwidthSchedulesOperations` - """ - api_version = self._get_api_version('bandwidth_schedules') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import BandwidthSchedulesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import BandwidthSchedulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'bandwidth_schedules'".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)), api_version) - - @property - def containers(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`ContainersOperations` - * 2021-02-01-preview: :class:`ContainersOperations` - """ - api_version = self._get_api_version('containers') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import ContainersOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import ContainersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'containers'".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)), api_version) - - @property - def devices(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`DevicesOperations` - * 2021-02-01-preview: :class:`DevicesOperations` - """ - api_version = self._get_api_version('devices') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import DevicesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import DevicesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'devices'".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)), api_version) - - @property - def jobs(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`JobsOperations` - * 2021-02-01-preview: :class:`JobsOperations` - """ - api_version = self._get_api_version('jobs') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import JobsOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import JobsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'jobs'".format(api_version)) - self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) - - @property - def monitoring_config(self): - """Instance depends on the API version: - - * 2021-02-01-preview: :class:`MonitoringConfigOperations` - """ - api_version = self._get_api_version('monitoring_config') - if api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import MonitoringConfigOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'monitoring_config'".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)), api_version) - - @property - def nodes(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`NodesOperations` - * 2021-02-01-preview: :class:`NodesOperations` - """ - api_version = self._get_api_version('nodes') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import NodesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import NodesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'nodes'".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)), api_version) - - @property - def operations(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`Operations` - * 2021-02-01-preview: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import Operations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_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)), api_version) - - @property - def operations_status(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`OperationsStatusOperations` - * 2021-02-01-preview: :class:`OperationsStatusOperations` - """ - api_version = self._get_api_version('operations_status') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import OperationsStatusOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import OperationsStatusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations_status'".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)), api_version) - - @property - def orders(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`OrdersOperations` - * 2021-02-01-preview: :class:`OrdersOperations` - """ - api_version = self._get_api_version('orders') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import OrdersOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_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)), api_version) - - @property - def roles(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`RolesOperations` - * 2021-02-01-preview: :class:`RolesOperations` - """ - api_version = self._get_api_version('roles') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import RolesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import RolesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'roles'".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)), api_version) - - @property - def shares(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`SharesOperations` - * 2021-02-01-preview: :class:`SharesOperations` - """ - api_version = self._get_api_version('shares') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import SharesOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import SharesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'shares'".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)), api_version) - - @property - def skus(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`SkusOperations` - """ - api_version = self._get_api_version('skus') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import SkusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'skus'".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)), api_version) - - @property - def storage_account_credentials(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`StorageAccountCredentialsOperations` - * 2021-02-01-preview: :class:`StorageAccountCredentialsOperations` - """ - api_version = self._get_api_version('storage_account_credentials') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import StorageAccountCredentialsOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import StorageAccountCredentialsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'storage_account_credentials'".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)), api_version) + 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.available_skus = AvailableSkusOperations(self._client, self._config, self._serialize, self._deserialize) + self.devices = DevicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize) + self.bandwidth_schedules = BandwidthSchedulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.nodes = NodesOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations_status = OperationsStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize) + self.roles = RolesOperations(self._client, self._config, self._serialize, self._deserialize) + self.addons = AddonsOperations(self._client, self._config, self._serialize, self._deserialize) + self.monitoring_config = MonitoringConfigOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.shares = SharesOperations(self._client, self._config, self._serialize, self._deserialize) + self.storage_account_credentials = StorageAccountCredentialsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.containers = ContainersOperations(self._client, self._config, self._serialize, self._deserialize) + self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize) + self.users = UsersOperations(self._client, self._config, self._serialize, self._deserialize) - @property - def storage_accounts(self): - """Instance depends on the API version: + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. - * 2019-08-01: :class:`StorageAccountsOperations` - * 2021-02-01-preview: :class:`StorageAccountsOperations` - """ - api_version = self._get_api_version('storage_accounts') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import StorageAccountsOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import StorageAccountsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'storage_accounts'".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)), api_version) + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + - @property - def triggers(self): - """Instance depends on the API version: + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - * 2019-08-01: :class:`TriggersOperations` - * 2021-02-01-preview: :class:`TriggersOperations` + :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 """ - api_version = self._get_api_version('triggers') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import TriggersOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import TriggersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'triggers'".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)), api_version) - @property - def users(self): - """Instance depends on the API version: + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - * 2019-08-01: :class:`UsersOperations` - * 2021-02-01-preview: :class:`UsersOperations` - """ - api_version = self._get_api_version('users') - if api_version == '2019-08-01': - from ..v2019_08_01.aio.operations import UsersOperations as OperationClass - elif api_version == '2021-02-01-preview': - from ..v2021_02_01_preview.aio.operations import UsersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'users'".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)), 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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_patch.py similarity index 61% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_patch.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_patch.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/__init__.py similarity index 100% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/__init__.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/__init__.py diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_addons_operations.py similarity index 89% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_addons_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_addons_operations.py index 7eac2285b430..27209ad23521 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_addons_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_addons_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._addons_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_role_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +51,7 @@ class AddonsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`addons` attribute. """ @@ -60,16 +59,17 @@ class AddonsOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_role( self, device_name: str, role_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Addon"]: + ) -> AsyncItemPaged["_models.Addon"]: """Lists all the addons configured in the role. :param device_name: The device name. Required. @@ -79,16 +79,13 @@ def list_by_role( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Addon or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.Addon] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AddonList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -122,7 +119,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -169,7 +166,7 @@ async def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Addon or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon + :rtype: ~azure.mgmt.databoxedge.models.Addon :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -183,9 +180,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Addon] = kwargs.pop("cls", None) _request = build_get_request( @@ -238,9 +233,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -313,13 +306,12 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param addon: The addon properties. Required. - :type addon: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon + :type addon: ~azure.mgmt.databoxedge.models.Addon :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Addon or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Addon] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -351,8 +343,7 @@ async def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Addon or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Addon] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -377,18 +368,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param addon: The addon properties. Is either a Addon type or a IO[bytes] type. Required. - :type addon: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon or IO[bytes] + :type addon: ~azure.mgmt.databoxedge.models.Addon or IO[bytes] :return: An instance of AsyncLROPoller that returns either Addon or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Addon] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.Addon] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -448,9 +436,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_request( @@ -509,9 +495,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_alerts_operations.py similarity index 86% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_alerts_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_alerts_operations.py index 8b7580203a9d..9ee67b4a0e72 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_alerts_operations.py @@ -5,10 +5,11 @@ # 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 +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +27,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._alerts_operations import build_get_request, build_list_by_data_box_edge_device_request +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +41,7 @@ class AlertsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`alerts` attribute. """ @@ -50,16 +49,17 @@ class AlertsOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Alert"]: + ) -> AsyncItemPaged["_models.Alert"]: """Gets all the alerts for a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. @@ -67,14 +67,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Alert or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Alert] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.Alert] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -107,7 +106,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -152,7 +151,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Alert or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Alert + :rtype: ~azure.mgmt.databoxedge.models.Alert :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -166,7 +165,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Alert] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_available_skus_operations.py similarity index 79% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_available_skus_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_available_skus_operations.py index 6764c9134457..bd9a40978269 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_available_skus_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_available_skus_operations.py @@ -5,10 +5,11 @@ # 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 +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._available_skus_operations import build_list_request +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ class AvailableSkusOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`available_skus` attribute. """ @@ -49,29 +48,27 @@ class AvailableSkusOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.DataBoxEdgeSku"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DataBoxEdgeSku"]: """List all the available Skus and information related to them. List all the available Skus and information related to them. :return: An iterator like instance of either DataBoxEdgeSku or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeSku] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.DataBoxEdgeSku] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeSkuList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -102,7 +99,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_bandwidth_schedules_operations.py similarity index 91% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_bandwidth_schedules_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_bandwidth_schedules_operations.py index dcc565095a10..2fc233598b88 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_bandwidth_schedules_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._bandwidth_schedules_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_data_box_edge_device_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +51,7 @@ class BandwidthSchedulesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`bandwidth_schedules` attribute. """ @@ -60,16 +59,17 @@ class BandwidthSchedulesOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.BandwidthSchedule"]: + ) -> AsyncItemPaged["_models.BandwidthSchedule"]: """Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. @@ -78,13 +78,13 @@ def list_by_data_box_edge_device( :type resource_group_name: str :return: An iterator like instance of either BandwidthSchedule or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BandwidthSchedulesList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -117,7 +117,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -162,7 +162,7 @@ async def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: BandwidthSchedule or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.models.BandwidthSchedule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -176,7 +176,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BandwidthSchedule] = kwargs.pop("cls", None) _request = build_get_request( @@ -227,7 +227,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -296,14 +296,13 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either BandwidthSchedule or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -333,8 +332,7 @@ async def begin_create_or_update( :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either BandwidthSchedule or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -357,17 +355,16 @@ async def begin_create_or_update( :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. Is either a BandwidthSchedule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule or IO[bytes] + :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule or IO[bytes] :return: An instance of AsyncLROPoller that returns either BandwidthSchedule or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.BandwidthSchedule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -426,7 +423,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -482,7 +479,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_containers_operations.py similarity index 93% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_containers_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_containers_operations.py index 33f3db18326e..c42aae66a0b3 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_containers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_containers_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._containers_operations import ( build_create_or_update_request, build_delete_request, @@ -38,11 +40,8 @@ build_list_by_storage_account_request, build_refresh_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +52,7 @@ class ContainersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`containers` attribute. """ @@ -61,16 +60,17 @@ class ContainersOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_storage_account( self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Container"]: + ) -> AsyncItemPaged["_models.Container"]: """Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. @@ -82,14 +82,13 @@ def list_by_storage_account( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Container or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Container] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -123,7 +122,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -172,7 +171,7 @@ async def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Container or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Container + :rtype: ~azure.mgmt.databoxedge.models.Container :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -186,7 +185,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Container] = kwargs.pop("cls", None) _request = build_get_request( @@ -239,7 +238,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -314,14 +313,13 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param container: The container properties. Required. - :type container: ~azure.mgmt.databoxedge.v2019_08_01.models.Container + :type container: ~azure.mgmt.databoxedge.models.Container :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Container or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Container] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -356,8 +354,7 @@ async def begin_create_or_update( :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Container or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Container] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -385,17 +382,16 @@ async def begin_create_or_update( :type resource_group_name: str :param container: The container properties. Is either a Container type or a IO[bytes] type. Required. - :type container: ~azure.mgmt.databoxedge.v2019_08_01.models.Container or IO[bytes] + :type container: ~azure.mgmt.databoxedge.models.Container or IO[bytes] :return: An instance of AsyncLROPoller that returns either Container or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Container] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.Container] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -455,7 +451,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -514,7 +510,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) @@ -567,7 +563,7 @@ async def _refresh_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_refresh_request( @@ -628,7 +624,7 @@ async def begin_refresh( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_devices_operations.py similarity index 90% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_devices_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_devices_operations.py index 41b3046cc106..d3853cfab123 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_devices_operations.py @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._devices_operations import ( build_create_or_update_request, build_create_or_update_security_settings_request, @@ -50,11 +52,8 @@ build_update_request, build_upload_certificate_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,7 +64,7 @@ class DevicesOperations: # pylint: disable=too-many-public-methods **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`devices` attribute. """ @@ -73,16 +72,17 @@ class DevicesOperations: # pylint: disable=too-many-public-methods 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription( self, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.DataBoxEdgeDevice"]: + ) -> AsyncItemPaged["_models.DataBoxEdgeDevice"]: """Gets all the Data Box Edge/Data Box Gateway devices in a subscription. :param expand: Specify $expand=details to populate additional fields related to the resource or @@ -91,15 +91,13 @@ def list_by_subscription( :type expand: str :return: An iterator like instance of either DataBoxEdgeDevice or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeDeviceList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -131,7 +129,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -166,7 +164,7 @@ async def get_next(next_link=None): @distributed_trace def list_by_resource_group( self, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.DataBoxEdgeDevice"]: + ) -> AsyncItemPaged["_models.DataBoxEdgeDevice"]: """Gets all the Data Box Edge/Data Box Gateway devices in a resource group. :param resource_group_name: The resource group name. Required. @@ -177,15 +175,13 @@ def list_by_resource_group( :type expand: str :return: An iterator like instance of either DataBoxEdgeDevice or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeDeviceList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -218,7 +214,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -259,7 +255,7 @@ async def get(self, device_name: str, resource_group_name: str, **kwargs: Any) - :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -273,9 +269,7 @@ async def get(self, device_name: str, resource_group_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeDevice] = kwargs.pop("cls", None) _request = build_get_request( @@ -324,9 +318,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -391,15 +383,13 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param data_box_edge_device: The resource object. Required. - :type data_box_edge_device: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -426,8 +416,7 @@ async def begin_create_or_update( :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -447,20 +436,16 @@ async def begin_create_or_update( :type resource_group_name: str :param data_box_edge_device: The resource object. Is either a DataBoxEdgeDevice type or a IO[bytes] type. Required. - :type data_box_edge_device: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice or IO[bytes] + :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice or IO[bytes] :return: An instance of AsyncLROPoller that returns either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.DataBoxEdgeDevice] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -516,9 +501,7 @@ async def _delete_initial(self, device_name: str, resource_group_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_request( @@ -569,9 +552,7 @@ async def begin_delete(self, device_name: str, resource_group_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -625,12 +606,12 @@ async def update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param parameters: The resource parameters. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :raises ~azure.core.exceptions.HttpResponseError: """ @@ -656,7 +637,7 @@ async def update( Default value is "application/json". :paramtype content_type: str :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :raises ~azure.core.exceptions.HttpResponseError: """ @@ -676,10 +657,9 @@ async def update( :type resource_group_name: str :param parameters: The resource parameters. Is either a DataBoxEdgeDevicePatch type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevicePatch or - IO[bytes] + :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch or IO[bytes] :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -693,9 +673,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.DataBoxEdgeDevice] = kwargs.pop("cls", None) @@ -752,9 +730,7 @@ async def _download_updates_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_download_updates_request( @@ -809,9 +785,7 @@ async def begin_download_updates( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -859,7 +833,7 @@ async def generate_certificate( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: GenerateCertResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.GenerateCertResponse + :rtype: ~azure.mgmt.databoxedge.models.GenerateCertResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -873,9 +847,7 @@ async def generate_certificate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GenerateCertResponse] = kwargs.pop("cls", None) _request = build_generate_certificate_request( @@ -917,7 +889,7 @@ async def get_extended_information( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -931,9 +903,7 @@ async def get_extended_information( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeDeviceExtendedInfo] = kwargs.pop("cls", None) _request = build_get_extended_information_request( @@ -978,9 +948,7 @@ async def _install_updates_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_install_updates_request( @@ -1035,9 +1003,7 @@ async def begin_install_updates( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -1085,7 +1051,7 @@ async def get_network_settings( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: NetworkSettings or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.models.NetworkSettings :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1099,9 +1065,7 @@ async def get_network_settings( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetworkSettings] = kwargs.pop("cls", None) _request = build_get_network_settings_request( @@ -1146,9 +1110,7 @@ async def _scan_for_updates_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_scan_for_updates_request( @@ -1203,9 +1165,7 @@ async def begin_scan_for_updates( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -1260,9 +1220,7 @@ async def _create_or_update_security_settings_initial( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1327,7 +1285,7 @@ async def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param security_settings: The security settings. Required. - :type security_settings: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1378,8 +1336,7 @@ async def begin_create_or_update_security_settings( :type resource_group_name: str :param security_settings: The security settings. Is either a SecuritySettings type or a IO[bytes] type. Required. - :type security_settings: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SecuritySettings or - IO[bytes] + :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings 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: @@ -1387,9 +1344,7 @@ async def begin_create_or_update_security_settings( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -1446,13 +1401,12 @@ async def update_extended_information( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param parameters: The patch object. Required. - :type parameters: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfoPatch + :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1478,7 +1432,7 @@ async def update_extended_information( Default value is "application/json". :paramtype content_type: str :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1498,11 +1452,10 @@ async def update_extended_information( :type resource_group_name: str :param parameters: The patch object. Is either a DataBoxEdgeDeviceExtendedInfoPatch type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfoPatch or + :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch or IO[bytes] :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1516,9 +1469,7 @@ async def update_extended_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.DataBoxEdgeDeviceExtendedInfo] = kwargs.pop("cls", None) @@ -1576,7 +1527,7 @@ async def get_update_summary( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: UpdateSummary or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.models.UpdateSummary :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1590,9 +1541,7 @@ async def get_update_summary( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UpdateSummary] = kwargs.pop("cls", None) _request = build_get_update_summary_request( @@ -1640,12 +1589,12 @@ async def upload_certificate( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param parameters: The upload certificate request. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1671,7 +1620,7 @@ async def upload_certificate( Default value is "application/json". :paramtype content_type: str :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1691,10 +1640,9 @@ async def upload_certificate( :type resource_group_name: str :param parameters: The upload certificate request. Is either a UploadCertificateRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateRequest - or IO[bytes] + :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest or IO[bytes] :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1708,9 +1656,7 @@ async def upload_certificate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.UploadCertificateResponse] = kwargs.pop("cls", None) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_jobs_operations.py similarity index 82% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_jobs_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_jobs_operations.py index 71569dd2b0cb..76dc689f1e78 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_jobs_operations.py @@ -5,9 +5,10 @@ # 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 collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +24,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._jobs_operations import build_get_request +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +38,7 @@ class JobsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`jobs` attribute. """ @@ -47,11 +46,12 @@ class JobsOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Job: @@ -66,7 +66,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Job + :rtype: ~azure.mgmt.databoxedge.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -80,7 +80,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_monitoring_config_operations.py similarity index 89% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_monitoring_config_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_monitoring_config_operations.py index 44ace9b6365e..ac013a0afcb4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_monitoring_config_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_monitoring_config_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._monitoring_config_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +51,7 @@ class MonitoringConfigOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`monitoring_config` attribute. """ @@ -60,17 +59,17 @@ class MonitoringConfigOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( self, device_name: str, role_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.MonitoringMetricConfiguration"]: - # pylint: disable=line-too-long + ) -> AsyncItemPaged["_models.MonitoringMetricConfiguration"]: """Lists metric configurations in a role. Lists metric configurations in a role. @@ -84,15 +83,13 @@ def list( :return: An iterator like instance of either MonitoringMetricConfiguration or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitoringMetricConfigurationList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -126,7 +123,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -173,7 +170,7 @@ async def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: MonitoringMetricConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration + :rtype: ~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -187,9 +184,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitoringMetricConfiguration] = kwargs.pop("cls", None) _request = build_get_request( @@ -240,9 +235,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -302,7 +295,6 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringMetricConfiguration]: - # pylint: disable=line-too-long """Creates a new metric configuration or updates an existing one for a role. Creates a new metric configuration or updates an existing one for a role. @@ -315,14 +307,14 @@ async def begin_create_or_update( :type resource_group_name: str :param monitoring_metric_configuration: The metric configuration. Required. :type monitoring_metric_configuration: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration + ~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -337,7 +329,6 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringMetricConfiguration]: - # pylint: disable=line-too-long """Creates a new metric configuration or updates an existing one for a role. Creates a new metric configuration or updates an existing one for a role. @@ -356,7 +347,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -369,7 +360,6 @@ async def begin_create_or_update( monitoring_metric_configuration: Union[_models.MonitoringMetricConfiguration, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.MonitoringMetricConfiguration]: - # pylint: disable=line-too-long """Creates a new metric configuration or updates an existing one for a role. Creates a new metric configuration or updates an existing one for a role. @@ -383,19 +373,17 @@ async def begin_create_or_update( :param monitoring_metric_configuration: The metric configuration. Is either a MonitoringMetricConfiguration type or a IO[bytes] type. Required. :type monitoring_metric_configuration: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration or IO[bytes] + ~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration or IO[bytes] :return: An instance of AsyncLROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.MonitoringMetricConfiguration] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -454,9 +442,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_request( @@ -514,9 +500,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_nodes_operations.py similarity index 81% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_nodes_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_nodes_operations.py index f65fde7821f5..ef8f210ef9ed 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_nodes_operations.py @@ -5,10 +5,11 @@ # 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 +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._nodes_operations import build_list_by_data_box_edge_device_request +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ class NodesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`nodes` attribute. """ @@ -49,16 +48,17 @@ class NodesOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Node"]: + ) -> AsyncItemPaged["_models.Node"]: """Gets all the nodes currently configured under this Data Box Edge device. :param device_name: The device name. Required. @@ -66,16 +66,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Node or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Node] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.Node] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NodeList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -108,7 +105,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_operations.py similarity index 80% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_operations.py index 2a25eddad7ed..ac4264616b9b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_operations.py @@ -5,10 +5,11 @@ # 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 +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -25,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import build_list_request +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`operations` attribute. """ @@ -49,27 +48,27 @@ class Operations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """List all the supported operations. List all the supported operations. :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Operation] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationsList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -99,7 +98,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_operations_status_operations.py similarity index 82% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations_status_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_operations_status_operations.py index 24d749f81e4d..b35bc6f2c3c4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_operations_status_operations.py @@ -5,9 +5,10 @@ # 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 collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +24,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations_status_operations import build_get_request +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,7 +38,7 @@ class OperationsStatusOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`operations_status` attribute. """ @@ -47,11 +46,12 @@ class OperationsStatusOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Job: @@ -66,7 +66,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Job + :rtype: ~azure.mgmt.databoxedge.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -80,7 +80,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_orders_operations.py similarity index 88% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_orders_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_orders_operations.py index 0fc64a9756de..a9550124cc6f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_orders_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._orders_operations import ( build_create_or_update_request, build_delete_request, @@ -38,11 +40,8 @@ build_list_by_data_box_edge_device_request, build_list_dc_access_code_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +52,7 @@ class OrdersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`orders` attribute. """ @@ -61,16 +60,17 @@ class OrdersOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Order"]: + ) -> AsyncItemPaged["_models.Order"]: """Lists all the orders related to a Data Box Edge/Data Box Gateway device. Lists all the orders related to a Data Box Edge/Data Box Gateway device. @@ -80,16 +80,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Order or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -122,7 +119,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -165,7 +162,7 @@ async def get(self, device_name: str, resource_group_name: str, **kwargs: Any) - :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Order or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order + :rtype: ~azure.mgmt.databoxedge.models.Order :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -179,9 +176,7 @@ async def get(self, device_name: str, resource_group_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Order] = kwargs.pop("cls", None) _request = build_get_request( @@ -226,9 +221,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -295,13 +288,12 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param order: The order to be created or updated. Required. - :type order: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order + :type order: ~azure.mgmt.databoxedge.models.Order :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Order or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -329,8 +321,7 @@ async def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Order or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -348,18 +339,15 @@ async def begin_create_or_update( :type resource_group_name: str :param order: The order to be created or updated. Is either a Order type or a IO[bytes] type. Required. - :type order: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order or IO[bytes] + :type order: ~azure.mgmt.databoxedge.models.Order or IO[bytes] :return: An instance of AsyncLROPoller that returns either Order or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.Order] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -415,9 +403,7 @@ async def _delete_initial(self, device_name: str, resource_group_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_request( @@ -470,9 +456,7 @@ async def begin_delete(self, device_name: str, resource_group_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -522,7 +506,7 @@ async def list_dc_access_code( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: DCAccessCode or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DCAccessCode + :rtype: ~azure.mgmt.databoxedge.models.DCAccessCode :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -536,9 +520,7 @@ async def list_dc_access_code( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DCAccessCode] = kwargs.pop("cls", None) _request = build_list_dc_access_code_request( diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_patch.py similarity index 61% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_patch.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_patch.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_roles_operations.py similarity index 92% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_roles_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_roles_operations.py index 3ae8f9aef0dd..99d57249de86 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_roles_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._roles_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_data_box_edge_device_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +51,7 @@ class RolesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`roles` attribute. """ @@ -60,16 +59,17 @@ class RolesOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Role"]: + ) -> AsyncItemPaged["_models.Role"]: """Lists all the roles configured in a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. @@ -77,14 +77,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Role or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Role] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RoleList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -117,7 +116,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -160,7 +159,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Role or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Role + :rtype: ~azure.mgmt.databoxedge.models.Role :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -174,7 +173,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Role] = kwargs.pop("cls", None) _request = build_get_request( @@ -220,7 +219,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -289,12 +288,12 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param role: The role properties. Required. - :type role: ~azure.mgmt.databoxedge.v2019_08_01.models.Role + :type role: ~azure.mgmt.databoxedge.models.Role :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Role or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Role] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -323,7 +322,7 @@ async def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Role or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Role] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -340,15 +339,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param role: The role properties. Is either a Role type or a IO[bytes] type. Required. - :type role: ~azure.mgmt.databoxedge.v2019_08_01.models.Role or IO[bytes] + :type role: ~azure.mgmt.databoxedge.models.Role or IO[bytes] :return: An instance of AsyncLROPoller that returns either Role or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Role] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.Role] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -407,7 +406,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -463,7 +462,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_shares_operations.py similarity index 93% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_shares_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_shares_operations.py index 664a04b1bb81..c9a39fb81938 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_shares_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._shares_operations import ( build_create_or_update_request, build_delete_request, @@ -38,11 +40,8 @@ build_list_by_data_box_edge_device_request, build_refresh_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +52,7 @@ class SharesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`shares` attribute. """ @@ -61,16 +60,17 @@ class SharesOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Share"]: + ) -> AsyncItemPaged["_models.Share"]: """Lists all the shares in a Data Box Edge/Data Box Gateway device. Lists all the shares in a Data Box Edge/Data Box Gateway device. @@ -80,14 +80,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Share or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Share] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ShareList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -120,7 +119,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -165,7 +164,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Share or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Share + :rtype: ~azure.mgmt.databoxedge.models.Share :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -179,7 +178,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Share] = kwargs.pop("cls", None) _request = build_get_request( @@ -230,7 +229,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -301,12 +300,12 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param share: The share properties. Required. - :type share: ~azure.mgmt.databoxedge.v2019_08_01.models.Share + :type share: ~azure.mgmt.databoxedge.models.Share :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Share or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Share] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -337,7 +336,7 @@ async def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Share or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Share] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -361,15 +360,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param share: The share properties. Is either a Share type or a IO[bytes] type. Required. - :type share: ~azure.mgmt.databoxedge.v2019_08_01.models.Share or IO[bytes] + :type share: ~azure.mgmt.databoxedge.models.Share or IO[bytes] :return: An instance of AsyncLROPoller that returns either Share or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Share] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.Share] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -428,7 +427,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -484,7 +483,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) @@ -536,7 +535,7 @@ async def _refresh_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_refresh_request( @@ -594,7 +593,7 @@ async def begin_refresh( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_storage_account_credentials_operations.py similarity index 92% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_account_credentials_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_storage_account_credentials_operations.py index 58190bbc80ac..87df7bf1ab90 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_storage_account_credentials_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._storage_account_credentials_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_data_box_edge_device_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +51,7 @@ class StorageAccountCredentialsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`storage_account_credentials` attribute. """ @@ -60,16 +59,17 @@ class StorageAccountCredentialsOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StorageAccountCredential"]: + ) -> AsyncItemPaged["_models.StorageAccountCredential"]: """Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. @@ -81,13 +81,13 @@ def list_by_data_box_edge_device( :return: An iterator like instance of either StorageAccountCredential or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountCredentialList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -120,7 +120,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -165,7 +165,7 @@ async def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: StorageAccountCredential or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.models.StorageAccountCredential :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -179,7 +179,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountCredential] = kwargs.pop("cls", None) _request = build_get_request( @@ -230,7 +230,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -299,15 +299,14 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param storage_account_credential: The storage account credential. Required. - :type storage_account_credential: - ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either StorageAccountCredential or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -338,7 +337,7 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either StorageAccountCredential or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -361,18 +360,18 @@ async def begin_create_or_update( :type resource_group_name: str :param storage_account_credential: The storage account credential. Is either a StorageAccountCredential type or a IO[bytes] type. Required. - :type storage_account_credential: - ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential or IO[bytes] + :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential or + IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageAccountCredential or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.StorageAccountCredential] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -431,7 +430,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -487,7 +486,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_storage_accounts_operations.py similarity index 90% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_accounts_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_storage_accounts_operations.py index 06afed2ced32..3a134688a78c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_storage_accounts_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._storage_accounts_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_data_box_edge_device_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +51,7 @@ class StorageAccountsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`storage_accounts` attribute. """ @@ -60,33 +59,33 @@ class StorageAccountsOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StorageAccount"]: - """Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + ) -> AsyncItemPaged["_models.StorageAccount"]: + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. - Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. :type device_name: str :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either StorageAccount or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -119,7 +118,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -166,7 +165,7 @@ async def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: StorageAccount or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount + :rtype: ~azure.mgmt.databoxedge.models.StorageAccount :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -180,7 +179,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None) _request = build_get_request( @@ -231,7 +230,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -302,14 +301,13 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param storage_account: The StorageAccount properties. Required. - :type storage_account: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount + :type storage_account: ~azure.mgmt.databoxedge.models.StorageAccount :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -341,8 +339,7 @@ async def begin_create_or_update( :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -367,17 +364,16 @@ async def begin_create_or_update( :type resource_group_name: str :param storage_account: The StorageAccount properties. Is either a StorageAccount type or a IO[bytes] type. Required. - :type storage_account: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount or IO[bytes] + :type storage_account: ~azure.mgmt.databoxedge.models.StorageAccount or IO[bytes] :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.StorageAccount] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -436,7 +432,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -492,7 +488,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_triggers_operations.py similarity index 92% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_triggers_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_triggers_operations.py index ce26c7dccf88..05e3c5a52ff9 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_triggers_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._triggers_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_data_box_edge_device_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +51,7 @@ class TriggersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`triggers` attribute. """ @@ -60,16 +59,17 @@ class TriggersOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Trigger"]: + ) -> AsyncItemPaged["_models.Trigger"]: """Lists all the triggers configured in the device. :param device_name: The device name. Required. @@ -80,14 +80,13 @@ def list_by_data_box_edge_device( tag property. Default value is None. :type filter: str :return: An iterator like instance of either Trigger or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TriggerList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -121,7 +120,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -164,7 +163,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Trigger or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Trigger + :rtype: ~azure.mgmt.databoxedge.models.Trigger :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -178,7 +177,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Trigger] = kwargs.pop("cls", None) _request = build_get_request( @@ -229,7 +228,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -298,13 +297,13 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param trigger: The trigger. Required. - :type trigger: ~azure.mgmt.databoxedge.v2019_08_01.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.models.Trigger :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Trigger or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -334,7 +333,7 @@ async def begin_create_or_update( :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either Trigger or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -356,16 +355,16 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param trigger: The trigger. Is either a Trigger type or a IO[bytes] type. Required. - :type trigger: ~azure.mgmt.databoxedge.v2019_08_01.models.Trigger or IO[bytes] + :type trigger: ~azure.mgmt.databoxedge.models.Trigger or IO[bytes] :return: An instance of AsyncLROPoller that returns either Trigger or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.Trigger] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -424,7 +423,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -480,7 +479,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_users_operations.py similarity index 91% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_users_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_users_operations.py index c0cacd05bbb0..7119ff6b9ae2 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/aio/operations/_users_operations.py @@ -5,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._users_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_data_box_edge_device_request, ) +from .._configuration import DataBoxEdgeManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +51,7 @@ class UsersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.aio.DataBoxEdgeManagementClient`'s :attr:`users` attribute. """ @@ -60,34 +59,35 @@ class UsersOperations: 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.User"]: + self, device_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.User"]: """Gets all the users registered on a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. :type device_name: str :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param filter: Specify $filter='UserType eq :code:``' to filter on user type property. - Default value is None. - :type filter: str + :param expand: Specify $expand=details to populate additional fields related to the resource or + Specify $skipToken=\\ :code:`` to populate the next page in the list. Default value is + None. + :type expand: str :return: An iterator like instance of either User or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.User] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UserList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -105,7 +105,7 @@ def prepare_request(next_link=None): device_name=device_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, - filter=filter, + expand=expand, api_version=api_version, headers=_headers, params=_params, @@ -121,7 +121,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -164,7 +164,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: User or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.User + :rtype: ~azure.mgmt.databoxedge.models.User :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -178,7 +178,7 @@ async def get(self, device_name: str, name: str, resource_group_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.User] = kwargs.pop("cls", None) _request = build_get_request( @@ -224,7 +224,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -294,12 +294,12 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param user: The user details. Required. - :type user: ~azure.mgmt.databoxedge.v2019_08_01.models.User + :type user: ~azure.mgmt.databoxedge.models.User :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either User or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.User] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -329,7 +329,7 @@ async def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either User or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.User] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -347,15 +347,15 @@ async def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param user: The user details. Is either a User type or a IO[bytes] type. Required. - :type user: ~azure.mgmt.databoxedge.v2019_08_01.models.User or IO[bytes] + :type user: ~azure.mgmt.databoxedge.models.User or IO[bytes] :return: An instance of AsyncLROPoller that returns either User or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.User] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.User] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -414,7 +414,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -470,7 +470,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models.py deleted file mode 100644 index 11b69d16b48b..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/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 .v2019_08_01.models import * diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/__init__.py similarity index 100% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/__init__.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/__init__.py diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_data_box_edge_management_client_enums.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_data_box_edge_management_client_enums.py similarity index 100% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_data_box_edge_management_client_enums.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_data_box_edge_management_client_enums.py diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models_py3.py similarity index 83% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models_py3.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models_py3.py index 77c5eefa156b..062df69e0202 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_models_py3.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models_py3.py @@ -10,7 +10,7 @@ import datetime from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .._utils import serialization as _serialization if TYPE_CHECKING: from .. import models as _models @@ -44,9 +44,9 @@ class ARMBaseModel(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None class Addon(ARMBaseModel): @@ -66,9 +66,9 @@ class Addon(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar kind: Addon type. Required. Known values are: "IotEdge" and "ArcForKubernetes". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonType + :vartype kind: str or ~azure.mgmt.databoxedge.models.AddonType :ivar system_data: Addon type. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData """ _validation = { @@ -93,7 +93,7 @@ def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.kind: Optional[str] = None - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None class AddonList(_serialization.Model): @@ -102,7 +102,7 @@ class AddonList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :vartype value: list[~azure.mgmt.databoxedge.models.Addon] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -120,8 +120,8 @@ class AddonList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.Addon"]] = None + self.next_link: Optional[str] = None class Address(_serialization.Model): @@ -209,7 +209,7 @@ class Alert(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: Alert generated in the resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar title: Alert title. :vartype title: str :ivar alert_type: Alert type. @@ -220,9 +220,9 @@ class Alert(ARMBaseModel): :vartype recommendation: str :ivar severity: Severity of the alert. Known values are: "Informational", "Warning", and "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AlertSeverity + :vartype severity: str or ~azure.mgmt.databoxedge.models.AlertSeverity :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AlertErrorDetails + :vartype error_details: ~azure.mgmt.databoxedge.models.AlertErrorDetails :ivar detailed_information: Alert details. :vartype detailed_information: dict[str, str] """ @@ -258,14 +258,14 @@ class Alert(ARMBaseModel): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.system_data = None - self.title = None - self.alert_type = None - self.appeared_at_date_time = None - self.recommendation = None - self.severity = None - self.error_details = None - self.detailed_information = None + self.system_data: Optional["_models.SystemData"] = None + self.title: Optional[str] = None + self.alert_type: Optional[str] = None + self.appeared_at_date_time: Optional[datetime.datetime] = None + self.recommendation: Optional[str] = None + self.severity: Optional[Union[str, "_models.AlertSeverity"]] = None + self.error_details: Optional["_models.AlertErrorDetails"] = None + self.detailed_information: Optional[Dict[str, str]] = None class AlertErrorDetails(_serialization.Model): @@ -296,9 +296,9 @@ class AlertErrorDetails(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.error_code = None - self.error_message = None - self.occurrences = None + self.error_code: Optional[str] = None + self.error_message: Optional[str] = None + self.occurrences: Optional[int] = None class AlertList(_serialization.Model): @@ -307,7 +307,7 @@ class AlertList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Alert] + :vartype value: list[~azure.mgmt.databoxedge.models.Alert] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -325,8 +325,8 @@ class AlertList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.Alert"]] = None + self.next_link: Optional[str] = None class ArcAddon(Addon): @@ -343,9 +343,9 @@ class ArcAddon(Addon): :ivar type: The hierarchical type of the object. :vartype type: str :ivar kind: Addon type. Required. Known values are: "IotEdge" and "ArcForKubernetes". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonType + :vartype kind: str or ~azure.mgmt.databoxedge.models.AddonType :ivar system_data: Addon type. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar subscription_id: Arc resource subscription Id. Required. :vartype subscription_id: str :ivar resource_group_name: Arc resource group name. Required. @@ -358,15 +358,13 @@ class ArcAddon(Addon): :vartype version: str :ivar host_platform: Host OS supported by the Arc addon. Known values are: "Windows" and "Linux". - :vartype host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :vartype host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType :ivar host_platform_type: Platform where the runtime is hosted. Known values are: "KubernetesCluster" and "LinuxVM". - :vartype host_platform_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.models.HostPlatformType :ivar provisioning_state: Addon Provisioning State. Known values are: "Invalid", "Creating", "Created", "Updating", "Reconfiguring", "Failed", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonState + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.models.AddonState """ _validation = { @@ -426,10 +424,10 @@ def __init__( self.resource_group_name = resource_group_name self.resource_name = resource_name self.resource_location = resource_location - self.version = None - self.host_platform = None - self.host_platform_type = None - self.provisioning_state = None + self.version: Optional[str] = None + self.host_platform: Optional[Union[str, "_models.PlatformType"]] = None + self.host_platform_type: Optional[Union[str, "_models.HostPlatformType"]] = None + self.provisioning_state: Optional[Union[str, "_models.AddonState"]] = None class AsymmetricEncryptedSecret(_serialization.Model): @@ -444,8 +442,7 @@ class AsymmetricEncryptedSecret(_serialization.Model): :vartype encryption_cert_thumbprint: str :ivar encryption_algorithm: The algorithm used to encrypt "Value". Required. Known values are: "None", "AES256", and "RSAES_PKCS1_v_1_5". - :vartype encryption_algorithm: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EncryptionAlgorithm + :vartype encryption_algorithm: str or ~azure.mgmt.databoxedge.models.EncryptionAlgorithm """ _validation = { @@ -475,8 +472,7 @@ def __init__( :paramtype encryption_cert_thumbprint: str :keyword encryption_algorithm: The algorithm used to encrypt "Value". Required. Known values are: "None", "AES256", and "RSAES_PKCS1_v_1_5". - :paramtype encryption_algorithm: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EncryptionAlgorithm + :paramtype encryption_algorithm: str or ~azure.mgmt.databoxedge.models.EncryptionAlgorithm """ super().__init__(**kwargs) self.value = value @@ -488,7 +484,7 @@ class Authentication(_serialization.Model): """Authentication mechanism for IoT devices. :ivar symmetric_key: Symmetric key for authentication. - :vartype symmetric_key: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SymmetricKey + :vartype symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey """ _attribute_map = { @@ -498,7 +494,7 @@ class Authentication(_serialization.Model): def __init__(self, *, symmetric_key: Optional["_models.SymmetricKey"] = None, **kwargs: Any) -> None: """ :keyword symmetric_key: Symmetric key for authentication. - :paramtype symmetric_key: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SymmetricKey + :paramtype symmetric_key: ~azure.mgmt.databoxedge.models.SymmetricKey """ super().__init__(**kwargs) self.symmetric_key = symmetric_key @@ -517,8 +513,7 @@ class AzureContainerInfo(_serialization.Model): :vartype container_name: str :ivar data_format: Storage format used for the file represented by the share. Required. Known values are: "BlockBlob", "PageBlob", and "AzureFile". - :vartype data_format: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerDataFormat + :vartype data_format: str or ~azure.mgmt.databoxedge.models.AzureContainerDataFormat """ _validation = { @@ -550,8 +545,7 @@ def __init__( :paramtype container_name: str :keyword data_format: Storage format used for the file represented by the share. Required. Known values are: "BlockBlob", "PageBlob", and "AzureFile". - :paramtype data_format: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerDataFormat + :paramtype data_format: str or ~azure.mgmt.databoxedge.models.AzureContainerDataFormat """ super().__init__(**kwargs) self.storage_account_credential_id = storage_account_credential_id @@ -573,7 +567,7 @@ class BandwidthSchedule(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: Bandwidth object related to ASE resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar start: The start time of the schedule in UTC. Required. :vartype start: str :ivar stop: The stop time of the schedule in UTC. Required. @@ -581,7 +575,7 @@ class BandwidthSchedule(ARMBaseModel): :ivar rate_in_mbps: The bandwidth rate in Mbps. Required. :vartype rate_in_mbps: int :ivar days: The days of the week when this schedule is applicable. Required. - :vartype days: list[str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DayOfWeek] + :vartype days: list[str or ~azure.mgmt.databoxedge.models.DayOfWeek] """ _validation = { @@ -617,10 +611,10 @@ def __init__( :keyword rate_in_mbps: The bandwidth rate in Mbps. Required. :paramtype rate_in_mbps: int :keyword days: The days of the week when this schedule is applicable. Required. - :paramtype days: list[str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DayOfWeek] + :paramtype days: list[str or ~azure.mgmt.databoxedge.models.DayOfWeek] """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.start = start self.stop = stop self.rate_in_mbps = rate_in_mbps @@ -633,7 +627,7 @@ class BandwidthSchedulesList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of bandwidth schedules. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] + :vartype value: list[~azure.mgmt.databoxedge.models.BandwidthSchedule] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -651,8 +645,8 @@ class BandwidthSchedulesList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.BandwidthSchedule"]] = None + self.next_link: Optional[str] = None class ClientAccessRight(_serialization.Model): @@ -664,8 +658,7 @@ class ClientAccessRight(_serialization.Model): :vartype client: str :ivar access_permission: Type of access to be allowed for the client. Required. Known values are: "NoAccess", "ReadOnly", and "ReadWrite". - :vartype access_permission: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ClientPermissionType + :vartype access_permission: str or ~azure.mgmt.databoxedge.models.ClientPermissionType """ _validation = { @@ -686,8 +679,7 @@ def __init__( :paramtype client: str :keyword access_permission: Type of access to be allowed for the client. Required. Known values are: "NoAccess", "ReadOnly", and "ReadWrite". - :paramtype access_permission: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ClientPermissionType + :paramtype access_permission: str or ~azure.mgmt.databoxedge.models.ClientPermissionType """ super().__init__(**kwargs) self.client = client @@ -712,9 +704,9 @@ class Role(ARMBaseModel): :vartype type: str :ivar kind: Role type. Required. Known values are: "IOT", "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", and "Kubernetes". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :vartype kind: str or ~azure.mgmt.databoxedge.models.RoleTypes :ivar system_data: Role configured on ASE resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData """ _validation = { @@ -746,7 +738,7 @@ def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.kind: Optional[str] = None - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None class CloudEdgeManagementRole(Role): @@ -764,17 +756,16 @@ class CloudEdgeManagementRole(Role): :vartype type: str :ivar kind: Role type. Required. Known values are: "IOT", "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", and "Kubernetes". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :vartype kind: str or ~azure.mgmt.databoxedge.models.RoleTypes :ivar system_data: Role configured on ASE resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar local_management_status: Local Edge Management Status. Known values are: "Enabled" and "Disabled". - :vartype local_management_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :vartype local_management_status: str or ~azure.mgmt.databoxedge.models.RoleStatus :ivar edge_profile: Edge Profile of the resource. - :vartype edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfile + :vartype edge_profile: ~azure.mgmt.databoxedge.models.EdgeProfile :ivar role_status: Role status. Known values are: "Enabled" and "Disabled". - :vartype role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :vartype role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus """ _validation = { @@ -801,12 +792,12 @@ class CloudEdgeManagementRole(Role): def __init__(self, *, role_status: Optional[Union[str, "_models.RoleStatus"]] = None, **kwargs: Any) -> None: """ :keyword role_status: Role status. Known values are: "Enabled" and "Disabled". - :paramtype role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :paramtype role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus """ super().__init__(**kwargs) self.kind: str = "CloudEdgeManagement" - self.local_management_status = None - self.edge_profile = None + self.local_management_status: Optional[Union[str, "_models.RoleStatus"]] = None + self.edge_profile: Optional["_models.EdgeProfile"] = None self.role_status = role_status @@ -820,7 +811,7 @@ class CloudErrorBody(_serialization.Model): interface. :vartype message: str :ivar details: A list of additional details about the error. - :vartype details: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.CloudErrorBody] + :vartype details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] """ _attribute_map = { @@ -845,7 +836,7 @@ def __init__( interface. :paramtype message: str :keyword details: A list of additional details about the error. - :paramtype details: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.CloudErrorBody] + :paramtype details: list[~azure.mgmt.databoxedge.models.CloudErrorBody] """ super().__init__(**kwargs) self.code = code @@ -885,10 +876,10 @@ class CniConfig(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.type = None - self.version = None - self.pod_subnet = None - self.service_subnet = None + self.type: Optional[str] = None + self.version: Optional[str] = None + self.pod_subnet: Optional[str] = None + self.service_subnet: Optional[str] = None class ComputeResource(_serialization.Model): @@ -987,17 +978,15 @@ class Container(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: Container in DataBoxEdge Resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar container_status: Current status of the container. Known values are: "OK", "Offline", "Unknown", "Updating", and "NeedsAttention". - :vartype container_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ContainerStatus + :vartype container_status: str or ~azure.mgmt.databoxedge.models.ContainerStatus :ivar data_format: DataFormat for Container. Required. Known values are: "BlockBlob", "PageBlob", and "AzureFile". - :vartype data_format: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerDataFormat + :vartype data_format: str or ~azure.mgmt.databoxedge.models.AzureContainerDataFormat :ivar refresh_details: Details of the refresh job on this container. - :vartype refresh_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RefreshDetails + :vartype refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails :ivar created_date_time: The UTC time when container got created. :vartype created_date_time: ~datetime.datetime """ @@ -1028,15 +1017,14 @@ def __init__(self, *, data_format: Union[str, "_models.AzureContainerDataFormat" """ :keyword data_format: DataFormat for Container. Required. Known values are: "BlockBlob", "PageBlob", and "AzureFile". - :paramtype data_format: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerDataFormat + :paramtype data_format: str or ~azure.mgmt.databoxedge.models.AzureContainerDataFormat """ super().__init__(**kwargs) - self.system_data = None - self.container_status = None + self.system_data: Optional["_models.SystemData"] = None + self.container_status: Optional[Union[str, "_models.ContainerStatus"]] = None self.data_format = data_format - self.refresh_details = None - self.created_date_time = None + self.refresh_details: Optional["_models.RefreshDetails"] = None + self.created_date_time: Optional[datetime.datetime] = None class ContainerList(_serialization.Model): @@ -1045,7 +1033,7 @@ class ContainerList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of containers. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] + :vartype value: list[~azure.mgmt.databoxedge.models.Container] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -1063,8 +1051,8 @@ class ContainerList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.Container"]] = None + self.next_link: Optional[str] = None class DataBoxEdgeDevice(ARMBaseModel): @@ -1089,21 +1077,21 @@ class DataBoxEdgeDevice(ARMBaseModel): this device (across resource groups). :vartype tags: dict[str, str] :ivar sku: The SKU type. - :vartype sku: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Sku + :vartype sku: ~azure.mgmt.databoxedge.models.Sku :ivar etag: The etag for the devices. :vartype etag: str :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceIdentity + :vartype identity: ~azure.mgmt.databoxedge.models.ResourceIdentity :ivar kind: The etag for the devices. Known values are: "AzureDataBoxGateway", "AzureStackEdge", "AzureStackHub", and "AzureModularDataCentre". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceKind + :vartype kind: str or ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceKind :ivar system_data: DataBoxEdge Resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Known values are: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", "PartiallyDisconnected", and "Maintenance". :vartype data_box_edge_device_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. :vartype serial_number: str :ivar description: The Description of the Data Box Edge/Gateway device. @@ -1111,7 +1099,7 @@ class DataBoxEdgeDevice(ARMBaseModel): :ivar model_description: The description of the Data Box Edge/Gateway device model. :vartype model_description: str :ivar device_type: The type of the Data Box Edge/Gateway device. "DataBoxEdgeDevice" - :vartype device_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DeviceType + :vartype device_type: str or ~azure.mgmt.databoxedge.models.DeviceType :ivar friendly_name: The Data Box Edge/Gateway device name. :vartype friendly_name: str :ivar culture: The Data Box Edge/Gateway device culture. @@ -1127,15 +1115,13 @@ class DataBoxEdgeDevice(ARMBaseModel): :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). :vartype device_hcs_version: str :ivar configured_role_types: Type of compute roles configured. - :vartype configured_role_types: list[str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes] + :vartype configured_role_types: list[str or ~azure.mgmt.databoxedge.models.RoleTypes] :ivar node_count: The number of nodes in the cluster. :vartype node_count: int :ivar resource_move_details: The details of the move operation on this resource. - :vartype resource_move_details: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceMoveDetails + :vartype resource_move_details: ~azure.mgmt.databoxedge.models.ResourceMoveDetails :ivar edge_profile: The details of Edge Profile for this resource. - :vartype edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfile + :vartype edge_profile: ~azure.mgmt.databoxedge.models.EdgeProfile """ _validation = { @@ -1212,16 +1198,16 @@ def __init__( # pylint: disable=too-many-locals group this device (across resource groups). :paramtype tags: dict[str, str] :keyword sku: The SKU type. - :paramtype sku: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Sku + :paramtype sku: ~azure.mgmt.databoxedge.models.Sku :keyword etag: The etag for the devices. :paramtype etag: str :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceIdentity + :paramtype identity: ~azure.mgmt.databoxedge.models.ResourceIdentity :keyword data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Known values are: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", "PartiallyDisconnected", and "Maintenance". :paramtype data_box_edge_device_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceStatus + ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceStatus """ super().__init__(**kwargs) self.location = location @@ -1229,24 +1215,24 @@ def __init__( # pylint: disable=too-many-locals self.sku = sku self.etag = etag self.identity = identity - self.kind = None - self.system_data = None + self.kind: Optional[Union[str, "_models.DataBoxEdgeDeviceKind"]] = None + self.system_data: Optional["_models.SystemData"] = None self.data_box_edge_device_status = data_box_edge_device_status - self.serial_number = None - self.description = None - self.model_description = None - self.device_type = None - self.friendly_name = None - self.culture = None - self.device_model = None - self.device_software_version = None - self.device_local_capacity = None - self.time_zone = None - self.device_hcs_version = None - self.configured_role_types = None - self.node_count = None - self.resource_move_details = None - self.edge_profile = None + self.serial_number: Optional[str] = None + self.description: Optional[str] = None + self.model_description: Optional[str] = None + self.device_type: Optional[Union[str, "_models.DeviceType"]] = None + self.friendly_name: Optional[str] = None + self.culture: Optional[str] = None + self.device_model: Optional[str] = None + self.device_software_version: Optional[str] = None + self.device_local_capacity: Optional[int] = None + self.time_zone: Optional[str] = None + self.device_hcs_version: Optional[str] = None + self.configured_role_types: Optional[List[Union[str, "_models.RoleTypes"]]] = None + self.node_count: Optional[int] = None + self.resource_move_details: Optional["_models.ResourceMoveDetails"] = None + self.edge_profile: Optional["_models.EdgeProfile"] = None class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): @@ -1280,11 +1266,10 @@ class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): :ivar key_vault_sync_status: Key vault sync status. Known values are: "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing", and "KeyVaultNotSynced". - :vartype key_vault_sync_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KeyVaultSyncStatus + :vartype key_vault_sync_status: str or ~azure.mgmt.databoxedge.models.KeyVaultSyncStatus :ivar device_secrets: Device secrets, will be returned only with ODataFilter $expand=deviceSecrets. - :vartype device_secrets: dict[str, ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Secret] + :vartype device_secrets: dict[str, ~azure.mgmt.databoxedge.models.Secret] """ _validation = { @@ -1341,19 +1326,18 @@ def __init__( :keyword key_vault_sync_status: Key vault sync status. Known values are: "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing", and "KeyVaultNotSynced". - :paramtype key_vault_sync_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KeyVaultSyncStatus + :paramtype key_vault_sync_status: str or ~azure.mgmt.databoxedge.models.KeyVaultSyncStatus """ super().__init__(**kwargs) self.encryption_key_thumbprint = encryption_key_thumbprint self.encryption_key = encryption_key - self.resource_key = None + self.resource_key: Optional[str] = None self.client_secret_store_id = client_secret_store_id self.client_secret_store_url = client_secret_store_url self.channel_integrity_key_name = channel_integrity_key_name self.channel_integrity_key_version = channel_integrity_key_version self.key_vault_sync_status = key_vault_sync_status - self.device_secrets = None + self.device_secrets: Optional[Dict[str, "_models.Secret"]] = None class DataBoxEdgeDeviceExtendedInfoPatch(_serialization.Model): @@ -1373,8 +1357,7 @@ class DataBoxEdgeDeviceExtendedInfoPatch(_serialization.Model): KeyVaultSyncPending, rest of the status will not be applicable. Known values are: "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing", and "KeyVaultNotSynced". - :vartype sync_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KeyVaultSyncStatus + :vartype sync_status: str or ~azure.mgmt.databoxedge.models.KeyVaultSyncStatus """ _attribute_map = { @@ -1410,8 +1393,7 @@ def __init__( KeyVaultSyncPending, rest of the status will not be applicable. Known values are: "KeyVaultSynced", "KeyVaultSyncFailed", "KeyVaultNotConfigured", "KeyVaultSyncPending", "KeyVaultSyncing", and "KeyVaultNotSynced". - :paramtype sync_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KeyVaultSyncStatus + :paramtype sync_status: str or ~azure.mgmt.databoxedge.models.KeyVaultSyncStatus """ super().__init__(**kwargs) self.client_secret_store_id = client_secret_store_id @@ -1427,7 +1409,7 @@ class DataBoxEdgeDeviceList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Data Box Edge/Gateway devices. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :vartype value: list[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -1445,8 +1427,8 @@ class DataBoxEdgeDeviceList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.DataBoxEdgeDevice"]] = None + self.next_link: Optional[str] = None class DataBoxEdgeDevicePatch(_serialization.Model): @@ -1455,9 +1437,9 @@ class DataBoxEdgeDevicePatch(_serialization.Model): :ivar tags: The tags attached to the Data Box Edge/Gateway resource. :vartype tags: dict[str, str] :ivar identity: Msi identity of the resource. - :vartype identity: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceIdentity + :vartype identity: ~azure.mgmt.databoxedge.models.ResourceIdentity :ivar edge_profile: Edge Profile property of the Data Box Edge/Gateway device. - :vartype edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfilePatch + :vartype edge_profile: ~azure.mgmt.databoxedge.models.EdgeProfilePatch """ _attribute_map = { @@ -1478,9 +1460,9 @@ def __init__( :keyword tags: The tags attached to the Data Box Edge/Gateway resource. :paramtype tags: dict[str, str] :keyword identity: Msi identity of the resource. - :paramtype identity: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceIdentity + :paramtype identity: ~azure.mgmt.databoxedge.models.ResourceIdentity :keyword edge_profile: Edge Profile property of the Data Box Edge/Gateway device. - :paramtype edge_profile: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfilePatch + :paramtype edge_profile: ~azure.mgmt.databoxedge.models.EdgeProfilePatch """ super().__init__(**kwargs) self.tags = tags @@ -1533,11 +1515,11 @@ class DataBoxEdgeSku(_serialization.Model): "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", and "Management". - :vartype name: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuName + :vartype name: str or ~azure.mgmt.databoxedge.models.SkuName :ivar kind: The Sku kind. :vartype kind: str :ivar tier: The Sku tier. "Standard" - :vartype tier: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuTier + :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier :ivar size: The Sku kind. :vartype size: str :ivar family: The Sku family. @@ -1547,26 +1529,22 @@ class DataBoxEdgeSku(_serialization.Model): :ivar api_versions: The API versions in which Sku is available. :vartype api_versions: list[str] :ivar location_info: Availability of the Sku for the location/zone/site. - :vartype location_info: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuLocationInfo] + :vartype location_info: list[~azure.mgmt.databoxedge.models.SkuLocationInfo] :ivar costs: The pricing info of the Sku. - :vartype costs: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] :ivar signup_option: Sku can be signed up by customer or not. Known values are: "None" and "Available". - :vartype signup_option: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuSignupOption + :vartype signup_option: str or ~azure.mgmt.databoxedge.models.SkuSignupOption :ivar version: Availability of the Sku as preview/stable. Known values are: "Stable" and "Preview". - :vartype version: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuVersion + :vartype version: str or ~azure.mgmt.databoxedge.models.SkuVersion :ivar availability: Links to the next set of results. Known values are: "Available" and "Unavailable". - :vartype availability: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuAvailability + :vartype availability: str or ~azure.mgmt.databoxedge.models.SkuAvailability :ivar shipment_types: List of Shipment Types supported by this SKU. - :vartype shipment_types: list[str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShipmentType] + :vartype shipment_types: list[str or ~azure.mgmt.databoxedge.models.ShipmentType] :ivar capabilities: The capability info of the SKU. - :vartype capabilities: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuCapability] + :vartype capabilities: list[~azure.mgmt.databoxedge.models.SkuCapability] """ _validation = { @@ -1608,21 +1586,21 @@ class DataBoxEdgeSku(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.resource_type = None - self.name = None - self.kind = None - self.tier = None - self.size = None - self.family = None - self.locations = None - self.api_versions = None - self.location_info = None - self.costs = None - self.signup_option = None - self.version = None - self.availability = None - self.shipment_types = None - self.capabilities = None + self.resource_type: Optional[str] = None + self.name: Optional[Union[str, "_models.SkuName"]] = None + self.kind: Optional[str] = None + self.tier: Optional[Union[str, "_models.SkuTier"]] = None + self.size: Optional[str] = None + self.family: Optional[str] = None + self.locations: Optional[List[str]] = None + self.api_versions: Optional[List[str]] = None + self.location_info: Optional[List["_models.SkuLocationInfo"]] = None + self.costs: Optional[List["_models.SkuCost"]] = None + self.signup_option: Optional[Union[str, "_models.SkuSignupOption"]] = None + self.version: Optional[Union[str, "_models.SkuVersion"]] = None + self.availability: Optional[Union[str, "_models.SkuAvailability"]] = None + self.shipment_types: Optional[List[Union[str, "_models.ShipmentType"]]] = None + self.capabilities: Optional[List["_models.SkuCapability"]] = None class DataBoxEdgeSkuList(_serialization.Model): @@ -1631,7 +1609,7 @@ class DataBoxEdgeSkuList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of ResourceType Sku. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeSku] + :vartype value: list[~azure.mgmt.databoxedge.models.DataBoxEdgeSku] :ivar next_link: Links to the next set of results. :vartype next_link: str """ @@ -1649,8 +1627,8 @@ class DataBoxEdgeSkuList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.DataBoxEdgeSku"]] = None + self.next_link: Optional[str] = None class DCAccessCode(_serialization.Model): @@ -1677,8 +1655,7 @@ class EdgeProfile(_serialization.Model): """Details about Edge Profile for the resource. :ivar subscription: Edge Profile Subscription. - :vartype subscription: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfileSubscription + :vartype subscription: ~azure.mgmt.databoxedge.models.EdgeProfileSubscription """ _attribute_map = { @@ -1688,8 +1665,7 @@ class EdgeProfile(_serialization.Model): def __init__(self, *, subscription: Optional["_models.EdgeProfileSubscription"] = None, **kwargs: Any) -> None: """ :keyword subscription: Edge Profile Subscription. - :paramtype subscription: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfileSubscription + :paramtype subscription: ~azure.mgmt.databoxedge.models.EdgeProfileSubscription """ super().__init__(**kwargs) self.subscription = subscription @@ -1699,8 +1675,7 @@ class EdgeProfilePatch(_serialization.Model): """The Data Box Edge/Gateway Edge Profile patch. :ivar subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. - :vartype subscription: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfileSubscriptionPatch + :vartype subscription: ~azure.mgmt.databoxedge.models.EdgeProfileSubscriptionPatch """ _attribute_map = { @@ -1710,8 +1685,7 @@ class EdgeProfilePatch(_serialization.Model): def __init__(self, *, subscription: Optional["_models.EdgeProfileSubscriptionPatch"] = None, **kwargs: Any) -> None: """ :keyword subscription: The Data Box Edge/Gateway Edge Profile Subscription patch. - :paramtype subscription: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EdgeProfileSubscriptionPatch + :paramtype subscription: ~azure.mgmt.databoxedge.models.EdgeProfileSubscriptionPatch """ super().__init__(**kwargs) self.subscription = subscription @@ -1726,7 +1700,7 @@ class EdgeProfileSubscription(_serialization.Model): :vartype id: str :ivar state: Known values are: "Registered", "Warned", "Suspended", "Deleted", and "Unregistered". - :vartype state: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SubscriptionState + :vartype state: str or ~azure.mgmt.databoxedge.models.SubscriptionState :ivar registration_date: :vartype registration_date: str :ivar subscription_id: @@ -1741,7 +1715,7 @@ class EdgeProfileSubscription(_serialization.Model): :vartype serialized_details: str :ivar registered_features: :vartype registered_features: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SubscriptionRegisteredFeatures] + list[~azure.mgmt.databoxedge.models.SubscriptionRegisteredFeatures] """ _attribute_map = { @@ -1779,7 +1753,7 @@ def __init__( :paramtype id: str :keyword state: Known values are: "Registered", "Warned", "Suspended", "Deleted", and "Unregistered". - :paramtype state: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SubscriptionState + :paramtype state: str or ~azure.mgmt.databoxedge.models.SubscriptionState :keyword registration_date: :paramtype registration_date: str :keyword subscription_id: @@ -1794,7 +1768,7 @@ def __init__( :paramtype serialized_details: str :keyword registered_features: :paramtype registered_features: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SubscriptionRegisteredFeatures] + list[~azure.mgmt.databoxedge.models.SubscriptionRegisteredFeatures] """ super().__init__(**kwargs) self.registration_id = registration_id @@ -1853,8 +1827,8 @@ class EtcdInfo(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.type = None - self.version = None + self.type: Optional[str] = None + self.version: Optional[str] = None class Trigger(ARMBaseModel): @@ -1874,9 +1848,9 @@ class Trigger(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: Trigger in DataBoxEdge Resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar kind: Trigger Kind. Required. Known values are: "FileEvent" and "PeriodicTimerEvent". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerEventType + :vartype kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType """ _validation = { @@ -1900,7 +1874,7 @@ class Trigger(ARMBaseModel): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.kind: Optional[str] = None @@ -1918,13 +1892,13 @@ class FileEventTrigger(Trigger): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: Trigger in DataBoxEdge Resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar kind: Trigger Kind. Required. Known values are: "FileEvent" and "PeriodicTimerEvent". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerEventType + :vartype kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType :ivar source_info: File event source details. Required. - :vartype source_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.FileSourceInfo + :vartype source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo :ivar sink_info: Role sink info. Required. - :vartype sink_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleSinkInfo + :vartype sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo :ivar custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -1963,9 +1937,9 @@ def __init__( ) -> None: """ :keyword source_info: File event source details. Required. - :paramtype source_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.FileSourceInfo + :paramtype source_info: ~azure.mgmt.databoxedge.models.FileSourceInfo :keyword sink_info: Role sink info. Required. - :paramtype sink_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleSinkInfo + :paramtype sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo :keyword custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -2057,7 +2031,7 @@ class ImageRepositoryCredential(_serialization.Model): :ivar user_name: Repository user name. Required. :vartype user_name: str :ivar password: Repository user password. - :vartype password: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :vartype password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret """ _validation = { @@ -2085,8 +2059,7 @@ def __init__( :keyword user_name: Repository user name. Required. :paramtype user_name: str :keyword password: Repository user password. - :paramtype password: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :paramtype password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret """ super().__init__(**kwargs) self.image_repository_url = image_repository_url @@ -2108,29 +2081,26 @@ class IoTAddon(Addon): :ivar type: The hierarchical type of the object. :vartype type: str :ivar kind: Addon type. Required. Known values are: "IotEdge" and "ArcForKubernetes". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonType + :vartype kind: str or ~azure.mgmt.databoxedge.models.AddonType :ivar system_data: Addon type. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar io_t_device_details: IoT device metadata to which appliance needs to be connected. Required. - :vartype io_t_device_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :vartype io_t_device_details: ~azure.mgmt.databoxedge.models.IoTDeviceInfo :ivar io_t_edge_device_details: IoT edge device to which the IoT Addon needs to be configured. Required. - :vartype io_t_edge_device_details: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :vartype io_t_edge_device_details: ~azure.mgmt.databoxedge.models.IoTDeviceInfo :ivar version: Version of IoT running on the appliance. :vartype version: str :ivar host_platform: Host OS supported by the IoT addon. Known values are: "Windows" and "Linux". - :vartype host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :vartype host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType :ivar host_platform_type: Platform where the runtime is hosted. Known values are: "KubernetesCluster" and "LinuxVM". - :vartype host_platform_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.models.HostPlatformType :ivar provisioning_state: Addon Provisioning State. Known values are: "Invalid", "Creating", "Created", "Updating", "Reconfiguring", "Failed", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AddonState + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.models.AddonState """ _validation = { @@ -2171,21 +2141,19 @@ def __init__( """ :keyword io_t_device_details: IoT device metadata to which appliance needs to be connected. Required. - :paramtype io_t_device_details: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :paramtype io_t_device_details: ~azure.mgmt.databoxedge.models.IoTDeviceInfo :keyword io_t_edge_device_details: IoT edge device to which the IoT Addon needs to be configured. Required. - :paramtype io_t_edge_device_details: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :paramtype io_t_edge_device_details: ~azure.mgmt.databoxedge.models.IoTDeviceInfo """ super().__init__(**kwargs) self.kind: str = "IotEdge" self.io_t_device_details = io_t_device_details self.io_t_edge_device_details = io_t_edge_device_details - self.version = None - self.host_platform = None - self.host_platform_type = None - self.provisioning_state = None + self.version: Optional[str] = None + self.host_platform: Optional[Union[str, "_models.PlatformType"]] = None + self.host_platform_type: Optional[Union[str, "_models.HostPlatformType"]] = None + self.provisioning_state: Optional[Union[str, "_models.AddonState"]] = None class IoTDeviceInfo(_serialization.Model): @@ -2200,7 +2168,7 @@ class IoTDeviceInfo(_serialization.Model): :ivar io_t_host_hub_id: Id for the IoT hub associated to the device. :vartype io_t_host_hub_id: str :ivar authentication: Encrypted IoT device/IoT edge device connection string. - :vartype authentication: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Authentication + :vartype authentication: ~azure.mgmt.databoxedge.models.Authentication """ _validation = { @@ -2232,7 +2200,7 @@ def __init__( :keyword io_t_host_hub_id: Id for the IoT hub associated to the device. :paramtype io_t_host_hub_id: str :keyword authentication: Encrypted IoT device/IoT edge device connection string. - :paramtype authentication: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Authentication + :paramtype authentication: ~azure.mgmt.databoxedge.models.Authentication """ super().__init__(**kwargs) self.device_id = device_id @@ -2252,8 +2220,7 @@ class IoTEdgeAgentInfo(_serialization.Model): :ivar tag: Image Tag. Required. :vartype tag: str :ivar image_repository: Image repository details. - :vartype image_repository: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ImageRepositoryCredential + :vartype image_repository: ~azure.mgmt.databoxedge.models.ImageRepositoryCredential """ _validation = { @@ -2281,8 +2248,7 @@ def __init__( :keyword tag: Image Tag. Required. :paramtype tag: str :keyword image_repository: Image repository details. - :paramtype image_repository: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ImageRepositoryCredential + :paramtype image_repository: ~azure.mgmt.databoxedge.models.ImageRepositoryCredential """ super().__init__(**kwargs) self.image_name = image_name @@ -2305,32 +2271,29 @@ class IoTRole(Role): :vartype type: str :ivar kind: Role type. Required. Known values are: "IOT", "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", and "Kubernetes". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :vartype kind: str or ~azure.mgmt.databoxedge.models.RoleTypes :ivar system_data: Role configured on ASE resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar host_platform: Host OS supported by the IoT role. Known values are: "Windows" and "Linux". - :vartype host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :vartype host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType :ivar io_t_device_details: IoT device metadata to which data box edge device needs to be connected. - :vartype io_t_device_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :vartype io_t_device_details: ~azure.mgmt.databoxedge.models.IoTDeviceInfo :ivar io_t_edge_device_details: IoT edge device to which the IoT role needs to be configured. - :vartype io_t_edge_device_details: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :vartype io_t_edge_device_details: ~azure.mgmt.databoxedge.models.IoTDeviceInfo :ivar share_mappings: Mount points of shares in role(s). - :vartype share_mappings: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] :ivar io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot runtime. - :vartype io_t_edge_agent_info: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTEdgeAgentInfo + :vartype io_t_edge_agent_info: ~azure.mgmt.databoxedge.models.IoTEdgeAgentInfo :ivar host_platform_type: Platform where the Iot runtime is hosted. Known values are: "KubernetesCluster" and "LinuxVM". - :vartype host_platform_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.models.HostPlatformType :ivar compute_resource: Resource allocation. - :vartype compute_resource: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ComputeResource + :vartype compute_resource: ~azure.mgmt.databoxedge.models.ComputeResource :ivar role_status: Role status. Known values are: "Enabled" and "Disabled". - :vartype role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :vartype role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus """ _validation = { @@ -2373,27 +2336,22 @@ def __init__( """ :keyword host_platform: Host OS supported by the IoT role. Known values are: "Windows" and "Linux". - :paramtype host_platform: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :paramtype host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType :keyword io_t_device_details: IoT device metadata to which data box edge device needs to be connected. - :paramtype io_t_device_details: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :paramtype io_t_device_details: ~azure.mgmt.databoxedge.models.IoTDeviceInfo :keyword io_t_edge_device_details: IoT edge device to which the IoT role needs to be configured. - :paramtype io_t_edge_device_details: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTDeviceInfo + :paramtype io_t_edge_device_details: ~azure.mgmt.databoxedge.models.IoTDeviceInfo :keyword share_mappings: Mount points of shares in role(s). - :paramtype share_mappings: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + :paramtype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] :keyword io_t_edge_agent_info: Iot edge agent details to download the agent and bootstrap iot runtime. - :paramtype io_t_edge_agent_info: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.IoTEdgeAgentInfo + :paramtype io_t_edge_agent_info: ~azure.mgmt.databoxedge.models.IoTEdgeAgentInfo :keyword compute_resource: Resource allocation. - :paramtype compute_resource: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ComputeResource + :paramtype compute_resource: ~azure.mgmt.databoxedge.models.ComputeResource :keyword role_status: Role status. Known values are: "Enabled" and "Disabled". - :paramtype role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :paramtype role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus """ super().__init__(**kwargs) self.kind: str = "IOT" @@ -2402,7 +2360,7 @@ def __init__( self.io_t_edge_device_details = io_t_edge_device_details self.share_mappings = share_mappings self.io_t_edge_agent_info = io_t_edge_agent_info - self.host_platform_type = None + self.host_platform_type: Optional[Union[str, "_models.HostPlatformType"]] = None self.compute_resource = compute_resource self.role_status = role_status @@ -2435,9 +2393,9 @@ class Ipv4Config(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.ip_address = None - self.subnet = None - self.gateway = None + self.ip_address: Optional[str] = None + self.subnet: Optional[str] = None + self.gateway: Optional[str] = None class Ipv6Config(_serialization.Model): @@ -2468,9 +2426,9 @@ class Ipv6Config(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.ip_address = None - self.prefix_length = None - self.gateway = None + self.ip_address: Optional[str] = None + self.prefix_length: Optional[int] = None + self.gateway: Optional[str] = None class Job(_serialization.Model): @@ -2486,7 +2444,7 @@ class Job(_serialization.Model): :vartype type: str :ivar status: The current status of the job. Known values are: "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", and "Scheduled". - :vartype status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobStatus + :vartype status: str or ~azure.mgmt.databoxedge.models.JobStatus :ivar start_time: The UTC date and time at which the job started. :vartype start_time: ~datetime.datetime :ivar end_time: The UTC date and time at which the job completed. @@ -2494,23 +2452,20 @@ class Job(_serialization.Model): :ivar percent_complete: The percentage of the job that is complete. :vartype percent_complete: int :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobErrorDetails + :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails :ivar job_type: The type of the job. Known values are: "Invalid", "ScanForUpdates", "DownloadUpdates", "InstallUpdates", "RefreshShare", "RefreshContainer", "Backup", "Restore", and "TriggerSupportPackage". - :vartype job_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobType + :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType :ivar current_stage: Current stage of the update operation. Known values are: "Unknown", "Initial", "ScanStarted", "ScanComplete", "ScanFailed", "DownloadStarted", "DownloadComplete", "DownloadFailed", "InstallStarted", "InstallComplete", "InstallFailed", "RebootInitiated", "Success", "Failure", "RescanStarted", "RescanComplete", and "RescanFailed". - :vartype current_stage: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateOperationStage + :vartype current_stage: str or ~azure.mgmt.databoxedge.models.UpdateOperationStage :ivar download_progress: The download progress. - :vartype download_progress: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateDownloadProgress + :vartype download_progress: ~azure.mgmt.databoxedge.models.UpdateDownloadProgress :ivar install_progress: The install progress. - :vartype install_progress: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateInstallProgress + :vartype install_progress: ~azure.mgmt.databoxedge.models.UpdateInstallProgress :ivar total_refresh_errors: Total number of errors encountered during the refresh process. :vartype total_refresh_errors: int :ivar error_manifest_file: Local share/remote container relative path to the error manifest @@ -2567,21 +2522,21 @@ def __init__(self, *, folder: Optional[str] = None, **kwargs: Any) -> None: :paramtype folder: str """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.status = None - self.start_time = None - self.end_time = None - self.percent_complete = None - self.error = None - self.job_type = None - self.current_stage = None - self.download_progress = None - self.install_progress = None - self.total_refresh_errors = None - self.error_manifest_file = None - self.refreshed_entity_id = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.status: Optional[Union[str, "_models.JobStatus"]] = None + self.start_time: Optional[datetime.datetime] = None + self.end_time: Optional[datetime.datetime] = None + self.percent_complete: Optional[int] = None + self.error: Optional["_models.JobErrorDetails"] = None + self.job_type: Optional[Union[str, "_models.JobType"]] = None + self.current_stage: Optional[Union[str, "_models.UpdateOperationStage"]] = None + self.download_progress: Optional["_models.UpdateDownloadProgress"] = None + self.install_progress: Optional["_models.UpdateInstallProgress"] = None + self.total_refresh_errors: Optional[int] = None + self.error_manifest_file: Optional[str] = None + self.refreshed_entity_id: Optional[str] = None self.folder = folder @@ -2591,7 +2546,7 @@ class JobErrorDetails(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar error_details: The error details. - :vartype error_details: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobErrorItem] + :vartype error_details: list[~azure.mgmt.databoxedge.models.JobErrorItem] :ivar code: The code intended for programmatic access. :vartype code: str :ivar message: The message that describes the error in detail. @@ -2613,9 +2568,9 @@ class JobErrorDetails(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.error_details = None - self.code = None - self.message = None + self.error_details: Optional[List["_models.JobErrorItem"]] = None + self.code: Optional[str] = None + self.message: Optional[str] = None class JobErrorItem(_serialization.Model): @@ -2646,9 +2601,9 @@ class JobErrorItem(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.recommendations = None - self.code = None - self.message = None + self.recommendations: Optional[List[str]] = None + self.code: Optional[str] = None + self.message: Optional[str] = None class KubernetesClusterInfo(_serialization.Model): @@ -2659,9 +2614,9 @@ class KubernetesClusterInfo(_serialization.Model): All required parameters must be populated in order to send to server. :ivar etcd_info: Etcd configuration. - :vartype etcd_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.EtcdInfo + :vartype etcd_info: ~azure.mgmt.databoxedge.models.EtcdInfo :ivar nodes: Kubernetes cluster nodes. - :vartype nodes: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.NodeInfo] + :vartype nodes: list[~azure.mgmt.databoxedge.models.NodeInfo] :ivar version: Kubernetes cluster version. Required. :vartype version: str """ @@ -2684,8 +2639,8 @@ def __init__(self, *, version: str, **kwargs: Any) -> None: :paramtype version: str """ super().__init__(**kwargs) - self.etcd_info = None - self.nodes = None + self.etcd_info: Optional["_models.EtcdInfo"] = None + self.nodes: Optional[List["_models.NodeInfo"]] = None self.version = version @@ -2715,7 +2670,7 @@ def __init__(self, *, ip_address: Optional[str] = None, **kwargs: Any) -> None: :paramtype ip_address: str """ super().__init__(**kwargs) - self.port = None + self.port: Optional[str] = None self.ip_address = ip_address @@ -2734,28 +2689,24 @@ class KubernetesRole(Role): :vartype type: str :ivar kind: Role type. Required. Known values are: "IOT", "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", and "Kubernetes". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :vartype kind: str or ~azure.mgmt.databoxedge.models.RoleTypes :ivar system_data: Role configured on ASE resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar host_platform: Host OS supported by the Kubernetes role. Known values are: "Windows" and "Linux". - :vartype host_platform: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :vartype host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType :ivar provisioning_state: State of Kubernetes deployment. Known values are: "Invalid", "Creating", "Created", "Updating", "Reconfiguring", "Failed", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesState + :vartype provisioning_state: str or ~azure.mgmt.databoxedge.models.KubernetesState :ivar host_platform_type: Platform where the runtime is hosted. Known values are: "KubernetesCluster" and "LinuxVM". - :vartype host_platform_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.HostPlatformType + :vartype host_platform_type: str or ~azure.mgmt.databoxedge.models.HostPlatformType :ivar kubernetes_cluster_info: Kubernetes cluster configuration. - :vartype kubernetes_cluster_info: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesClusterInfo + :vartype kubernetes_cluster_info: ~azure.mgmt.databoxedge.models.KubernetesClusterInfo :ivar kubernetes_role_resources: Kubernetes role resources. - :vartype kubernetes_role_resources: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleResources + :vartype kubernetes_role_resources: ~azure.mgmt.databoxedge.models.KubernetesRoleResources :ivar role_status: Role status. Known values are: "Enabled" and "Disabled". - :vartype role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :vartype role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus """ _validation = { @@ -2794,22 +2745,19 @@ def __init__( """ :keyword host_platform: Host OS supported by the Kubernetes role. Known values are: "Windows" and "Linux". - :paramtype host_platform: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PlatformType + :paramtype host_platform: str or ~azure.mgmt.databoxedge.models.PlatformType :keyword kubernetes_cluster_info: Kubernetes cluster configuration. - :paramtype kubernetes_cluster_info: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesClusterInfo + :paramtype kubernetes_cluster_info: ~azure.mgmt.databoxedge.models.KubernetesClusterInfo :keyword kubernetes_role_resources: Kubernetes role resources. - :paramtype kubernetes_role_resources: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleResources + :paramtype kubernetes_role_resources: ~azure.mgmt.databoxedge.models.KubernetesRoleResources :keyword role_status: Role status. Known values are: "Enabled" and "Disabled". - :paramtype role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :paramtype role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus """ super().__init__(**kwargs) self.kind: str = "Kubernetes" self.host_platform = host_platform - self.provisioning_state = None - self.host_platform_type = None + self.provisioning_state: Optional[Union[str, "_models.KubernetesState"]] = None + self.host_platform_type: Optional[Union[str, "_models.HostPlatformType"]] = None self.kubernetes_cluster_info = kubernetes_cluster_info self.kubernetes_role_resources = kubernetes_role_resources self.role_status = role_status @@ -2849,8 +2797,8 @@ def __init__(self, *, vm_profile: str, **kwargs: Any) -> None: """ super().__init__(**kwargs) self.vm_profile = vm_profile - self.memory_in_bytes = None - self.processor_count = None + self.memory_in_bytes: Optional[int] = None + self.processor_count: Optional[int] = None class KubernetesRoleNetwork(_serialization.Model): @@ -2859,10 +2807,9 @@ class KubernetesRoleNetwork(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar cni_config: Cni configuration. - :vartype cni_config: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.CniConfig + :vartype cni_config: ~azure.mgmt.databoxedge.models.CniConfig :ivar load_balancer_config: Load balancer configuration. - :vartype load_balancer_config: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.LoadBalancerConfig + :vartype load_balancer_config: ~azure.mgmt.databoxedge.models.LoadBalancerConfig """ _validation = { @@ -2878,8 +2825,8 @@ class KubernetesRoleNetwork(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.cni_config = None - self.load_balancer_config = None + self.cni_config: Optional["_models.CniConfig"] = None + self.load_balancer_config: Optional["_models.LoadBalancerConfig"] = None class KubernetesRoleResources(_serialization.Model): @@ -2890,11 +2837,11 @@ class KubernetesRoleResources(_serialization.Model): All required parameters must be populated in order to send to server. :ivar storage: Kubernetes role storage resource. - :vartype storage: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleStorage + :vartype storage: ~azure.mgmt.databoxedge.models.KubernetesRoleStorage :ivar compute: Kubernetes role compute resource. Required. - :vartype compute: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleCompute + :vartype compute: ~azure.mgmt.databoxedge.models.KubernetesRoleCompute :ivar network: Kubernetes role network resource. - :vartype network: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleNetwork + :vartype network: ~azure.mgmt.databoxedge.models.KubernetesRoleNetwork """ _validation = { @@ -2917,14 +2864,14 @@ def __init__( ) -> None: """ :keyword storage: Kubernetes role storage resource. - :paramtype storage: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleStorage + :paramtype storage: ~azure.mgmt.databoxedge.models.KubernetesRoleStorage :keyword compute: Kubernetes role compute resource. Required. - :paramtype compute: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleCompute + :paramtype compute: ~azure.mgmt.databoxedge.models.KubernetesRoleCompute """ super().__init__(**kwargs) self.storage = storage self.compute = compute - self.network = None + self.network: Optional["_models.KubernetesRoleNetwork"] = None class KubernetesRoleStorage(_serialization.Model): @@ -2933,10 +2880,9 @@ class KubernetesRoleStorage(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar storage_classes: Kubernetes storage class info. - :vartype storage_classes: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesRoleStorageClassInfo] + :vartype storage_classes: list[~azure.mgmt.databoxedge.models.KubernetesRoleStorageClassInfo] :ivar endpoints: Mount points of shares in role(s). - :vartype endpoints: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + :vartype endpoints: list[~azure.mgmt.databoxedge.models.MountPointMap] """ _validation = { @@ -2951,10 +2897,10 @@ class KubernetesRoleStorage(_serialization.Model): def __init__(self, *, endpoints: Optional[List["_models.MountPointMap"]] = None, **kwargs: Any) -> None: """ :keyword endpoints: Mount points of shares in role(s). - :paramtype endpoints: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + :paramtype endpoints: list[~azure.mgmt.databoxedge.models.MountPointMap] """ super().__init__(**kwargs) - self.storage_classes = None + self.storage_classes: Optional[List["_models.KubernetesRoleStorageClassInfo"]] = None self.endpoints = endpoints @@ -2969,8 +2915,7 @@ class KubernetesRoleStorageClassInfo(_serialization.Model): :vartype type: str :ivar posix_compliant: If provisioned storage is posix compliant. Known values are: "Invalid", "Enabled", and "Disabled". - :vartype posix_compliant: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PosixComplianceStatus + :vartype posix_compliant: str or ~azure.mgmt.databoxedge.models.PosixComplianceStatus """ _validation = { @@ -2988,9 +2933,9 @@ class KubernetesRoleStorageClassInfo(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.type = None - self.posix_compliant = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.posix_compliant: Optional[Union[str, "_models.PosixComplianceStatus"]] = None class LoadBalancerConfig(_serialization.Model): @@ -3017,8 +2962,8 @@ class LoadBalancerConfig(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.type = None - self.version = None + self.type: Optional[str] = None + self.version: Optional[str] = None class MECRole(Role): @@ -3036,18 +2981,17 @@ class MECRole(Role): :vartype type: str :ivar kind: Role type. Required. Known values are: "IOT", "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", and "Kubernetes". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :vartype kind: str or ~azure.mgmt.databoxedge.models.RoleTypes :ivar system_data: Role configured on ASE resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar connection_string: Activation key of the MEC. - :vartype connection_string: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :vartype connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret :ivar controller_endpoint: Controller Endpoint. :vartype controller_endpoint: str :ivar resource_unique_id: Unique Id of the Resource. :vartype resource_unique_id: str :ivar role_status: Role status. Known values are: "Enabled" and "Disabled". - :vartype role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :vartype role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus """ _validation = { @@ -3081,14 +3025,13 @@ def __init__( ) -> None: """ :keyword connection_string: Activation key of the MEC. - :paramtype connection_string: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :paramtype connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret :keyword controller_endpoint: Controller Endpoint. :paramtype controller_endpoint: str :keyword resource_unique_id: Unique Id of the Resource. :paramtype resource_unique_id: str :keyword role_status: Role status. Known values are: "Enabled" and "Disabled". - :paramtype role_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleStatus + :paramtype role_status: str or ~azure.mgmt.databoxedge.models.RoleStatus """ super().__init__(**kwargs) self.kind: str = "MEC" @@ -3111,8 +3054,7 @@ class MetricConfiguration(_serialization.Model): required if MDMAccount is specified. :vartype metric_name_space: str :ivar counter_sets: Host name for the IoT hub associated to the device. Required. - :vartype counter_sets: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCounterSet] + :vartype counter_sets: list[~azure.mgmt.databoxedge.models.MetricCounterSet] """ _validation = { @@ -3145,8 +3087,7 @@ def __init__( required if MDMAccount is specified. :paramtype metric_name_space: str :keyword counter_sets: Host name for the IoT hub associated to the device. Required. - :paramtype counter_sets: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCounterSet] + :paramtype counter_sets: list[~azure.mgmt.databoxedge.models.MetricCounterSet] """ super().__init__(**kwargs) self.resource_id = resource_id @@ -3165,11 +3106,9 @@ class MetricCounter(_serialization.Model): :ivar instance: The instance from which counter should be collected. :vartype instance: str :ivar dimension_filter: The dimension filter. - :vartype dimension_filter: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimension] + :vartype dimension_filter: list[~azure.mgmt.databoxedge.models.MetricDimension] :ivar additional_dimensions: The additional dimensions to be added to metric. - :vartype additional_dimensions: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimension] + :vartype additional_dimensions: list[~azure.mgmt.databoxedge.models.MetricDimension] """ _validation = { @@ -3198,11 +3137,9 @@ def __init__( :keyword instance: The instance from which counter should be collected. :paramtype instance: str :keyword dimension_filter: The dimension filter. - :paramtype dimension_filter: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimension] + :paramtype dimension_filter: list[~azure.mgmt.databoxedge.models.MetricDimension] :keyword additional_dimensions: The additional dimensions to be added to metric. - :paramtype additional_dimensions: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimension] + :paramtype additional_dimensions: list[~azure.mgmt.databoxedge.models.MetricDimension] """ super().__init__(**kwargs) self.name = name @@ -3217,7 +3154,7 @@ class MetricCounterSet(_serialization.Model): All required parameters must be populated in order to send to server. :ivar counters: The counters that should be collected in this set. Required. - :vartype counters: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCounter] + :vartype counters: list[~azure.mgmt.databoxedge.models.MetricCounter] """ _validation = { @@ -3231,7 +3168,7 @@ class MetricCounterSet(_serialization.Model): def __init__(self, *, counters: List["_models.MetricCounter"], **kwargs: Any) -> None: """ :keyword counters: The counters that should be collected in this set. Required. - :paramtype counters: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCounter] + :paramtype counters: list[~azure.mgmt.databoxedge.models.MetricCounter] """ super().__init__(**kwargs) self.counters = counters @@ -3320,25 +3257,23 @@ class MetricSpecificationV1(_serialization.Model): :vartype display_description: str :ivar unit: Metric units. Known values are: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", and "CountPerSecond". - :vartype unit: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricUnit + :vartype unit: str or ~azure.mgmt.databoxedge.models.MetricUnit :ivar aggregation_type: Metric aggregation type. Known values are: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", and "Count". - :vartype aggregation_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricAggregationType + :vartype aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType :ivar dimensions: Metric dimensions, other than default dimension which is resource. - :vartype dimensions: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimensionV1] + :vartype dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] :ivar fill_gap_with_zero: Set true to fill the gaps with zero. :vartype fill_gap_with_zero: bool :ivar category: Metric category. Known values are: "Capacity" and "Transaction". - :vartype category: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCategory + :vartype category: str or ~azure.mgmt.databoxedge.models.MetricCategory :ivar resource_id_dimension_name_override: Resource name override. :vartype resource_id_dimension_name_override: str :ivar supported_time_grain_types: Support granularity of metrics. - :vartype supported_time_grain_types: list[str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TimeGrain] + :vartype supported_time_grain_types: list[str or ~azure.mgmt.databoxedge.models.TimeGrain] :ivar supported_aggregation_types: Support metric aggregation type. :vartype supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricAggregationType] + ~azure.mgmt.databoxedge.models.MetricAggregationType] """ _attribute_map = { @@ -3380,26 +3315,23 @@ def __init__( :paramtype display_description: str :keyword unit: Metric units. Known values are: "NotSpecified", "Percent", "Count", "Seconds", "Milliseconds", "Bytes", "BytesPerSecond", and "CountPerSecond". - :paramtype unit: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricUnit + :paramtype unit: str or ~azure.mgmt.databoxedge.models.MetricUnit :keyword aggregation_type: Metric aggregation type. Known values are: "NotSpecified", "None", "Average", "Minimum", "Maximum", "Total", and "Count". - :paramtype aggregation_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricAggregationType + :paramtype aggregation_type: str or ~azure.mgmt.databoxedge.models.MetricAggregationType :keyword dimensions: Metric dimensions, other than default dimension which is resource. - :paramtype dimensions: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricDimensionV1] + :paramtype dimensions: list[~azure.mgmt.databoxedge.models.MetricDimensionV1] :keyword fill_gap_with_zero: Set true to fill the gaps with zero. :paramtype fill_gap_with_zero: bool :keyword category: Metric category. Known values are: "Capacity" and "Transaction". - :paramtype category: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricCategory + :paramtype category: str or ~azure.mgmt.databoxedge.models.MetricCategory :keyword resource_id_dimension_name_override: Resource name override. :paramtype resource_id_dimension_name_override: str :keyword supported_time_grain_types: Support granularity of metrics. - :paramtype supported_time_grain_types: list[str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TimeGrain] + :paramtype supported_time_grain_types: list[str or ~azure.mgmt.databoxedge.models.TimeGrain] :keyword supported_aggregation_types: Support metric aggregation type. :paramtype supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricAggregationType] + ~azure.mgmt.databoxedge.models.MetricAggregationType] """ super().__init__(**kwargs) self.name = name @@ -3429,10 +3361,9 @@ class MonitoringMetricConfiguration(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: MonitoringConfiguration on ASE device. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar metric_configurations: The metrics configuration details. Required. - :vartype metric_configurations: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricConfiguration] + :vartype metric_configurations: list[~azure.mgmt.databoxedge.models.MetricConfiguration] """ _validation = { @@ -3454,11 +3385,10 @@ class MonitoringMetricConfiguration(ARMBaseModel): def __init__(self, *, metric_configurations: List["_models.MetricConfiguration"], **kwargs: Any) -> None: """ :keyword metric_configurations: The metrics configuration details. Required. - :paramtype metric_configurations: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricConfiguration] + :paramtype metric_configurations: list[~azure.mgmt.databoxedge.models.MetricConfiguration] """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.metric_configurations = metric_configurations @@ -3468,8 +3398,7 @@ class MonitoringMetricConfigurationList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of metric configurations. - :vartype value: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + :vartype value: list[~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3487,8 +3416,8 @@ class MonitoringMetricConfigurationList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.MonitoringMetricConfiguration"]] = None + self.next_link: Optional[str] = None class MountPointMap(_serialization.Model): @@ -3505,10 +3434,10 @@ class MountPointMap(_serialization.Model): :ivar mount_point: Mount point for the share. :vartype mount_point: str :ivar mount_type: Mounting type. Known values are: "Volume" and "HostPath". - :vartype mount_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountType + :vartype mount_type: str or ~azure.mgmt.databoxedge.models.MountType :ivar role_type: Role type. Known values are: "IOT", "ASA", "Functions", "Cognitive", "MEC", "CloudEdgeManagement", and "Kubernetes". - :vartype role_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleTypes + :vartype role_type: str or ~azure.mgmt.databoxedge.models.RoleTypes """ _validation = { @@ -3534,10 +3463,10 @@ def __init__(self, *, share_id: str, **kwargs: Any) -> None: """ super().__init__(**kwargs) self.share_id = share_id - self.role_id = None - self.mount_point = None - self.mount_type = None - self.role_type = None + self.role_id: Optional[str] = None + self.mount_point: Optional[str] = None + self.mount_type: Optional[Union[str, "_models.MountType"]] = None + self.role_type: Optional[Union[str, "_models.RoleTypes"]] = None class NetworkAdapter(_serialization.Model): @@ -3548,8 +3477,7 @@ class NetworkAdapter(_serialization.Model): :ivar adapter_id: Instance ID of network adapter. :vartype adapter_id: str :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterPosition + :vartype adapter_position: ~azure.mgmt.databoxedge.models.NetworkAdapterPosition :ivar index: Logical index of the adapter. :vartype index: int :ivar node_id: Node ID of the network adapter. @@ -3564,19 +3492,17 @@ class NetworkAdapter(_serialization.Model): :vartype link_speed: int :ivar status: Value indicating whether this adapter is valid. Known values are: "Inactive" and "Active". - :vartype status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterStatus + :vartype status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterStatus :ivar rdma_status: Value indicating whether this adapter is RDMA capable. Known values are: "Incapable" and "Capable". - :vartype rdma_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterRDMAStatus + :vartype rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus :ivar dhcp_status: Value indicating whether this adapter has DHCP enabled. Known values are: "Disabled" and "Enabled". - :vartype dhcp_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterDHCPStatus + :vartype dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Ipv4Config + :vartype ipv4_configuration: ~azure.mgmt.databoxedge.models.Ipv4Config :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Ipv6Config + :vartype ipv6_configuration: ~azure.mgmt.databoxedge.models.Ipv6Config :ivar ipv6_link_local_address: The IPv6 local address. :vartype ipv6_link_local_address: str :ivar dns_servers: The list of DNS Servers of the device. @@ -3627,29 +3553,27 @@ def __init__( """ :keyword rdma_status: Value indicating whether this adapter is RDMA capable. Known values are: "Incapable" and "Capable". - :paramtype rdma_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterRDMAStatus + :paramtype rdma_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterRDMAStatus :keyword dhcp_status: Value indicating whether this adapter has DHCP enabled. Known values are: "Disabled" and "Enabled". - :paramtype dhcp_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapterDHCPStatus + :paramtype dhcp_status: str or ~azure.mgmt.databoxedge.models.NetworkAdapterDHCPStatus """ super().__init__(**kwargs) - self.adapter_id = None - self.adapter_position = None - self.index = None - self.node_id = None - self.network_adapter_name = None - self.label = None - self.mac_address = None - self.link_speed = None - self.status = None + self.adapter_id: Optional[str] = None + self.adapter_position: Optional["_models.NetworkAdapterPosition"] = None + self.index: Optional[int] = None + self.node_id: Optional[str] = None + self.network_adapter_name: Optional[str] = None + self.label: Optional[str] = None + self.mac_address: Optional[str] = None + self.link_speed: Optional[int] = None + self.status: Optional[Union[str, "_models.NetworkAdapterStatus"]] = None self.rdma_status = rdma_status self.dhcp_status = dhcp_status - self.ipv4_configuration = None - self.ipv6_configuration = None - self.ipv6_link_local_address = None - self.dns_servers = None + self.ipv4_configuration: Optional["_models.Ipv4Config"] = None + self.ipv6_configuration: Optional["_models.Ipv6Config"] = None + self.ipv6_link_local_address: Optional[str] = None + self.dns_servers: Optional[List[str]] = None class NetworkAdapterPosition(_serialization.Model): @@ -3658,7 +3582,7 @@ class NetworkAdapterPosition(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar network_group: The network group. Known values are: "None", "NonRDMA", and "RDMA". - :vartype network_group: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkGroup + :vartype network_group: str or ~azure.mgmt.databoxedge.models.NetworkGroup :ivar port: The port. :vartype port: int """ @@ -3676,8 +3600,8 @@ class NetworkAdapterPosition(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.network_group = None - self.port = None + self.network_group: Optional[Union[str, "_models.NetworkGroup"]] = None + self.port: Optional[int] = None class NetworkSettings(ARMBaseModel): @@ -3692,10 +3616,9 @@ class NetworkSettings(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: NetworkSettings on ASE device. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar network_adapters: The network adapter list on the device. - :vartype network_adapters: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkAdapter] + :vartype network_adapters: list[~azure.mgmt.databoxedge.models.NetworkAdapter] """ _validation = { @@ -3717,8 +3640,8 @@ class NetworkSettings(ARMBaseModel): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.system_data = None - self.network_adapters = None + self.system_data: Optional["_models.SystemData"] = None + self.network_adapters: Optional[List["_models.NetworkAdapter"]] = None class Node(ARMBaseModel): @@ -3737,7 +3660,7 @@ class Node(ARMBaseModel): :vartype type: str :ivar node_status: The current status of the individual node. Known values are: "Unknown", "Up", "Down", "Rebooting", and "ShuttingDown". - :vartype node_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NodeStatus + :vartype node_status: str or ~azure.mgmt.databoxedge.models.NodeStatus :ivar node_chassis_serial_number: Serial number of the Chassis. :vartype node_chassis_serial_number: str :ivar node_serial_number: Serial number of the individual node. @@ -3782,13 +3705,13 @@ class Node(ARMBaseModel): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.node_status = None - self.node_chassis_serial_number = None - self.node_serial_number = None - self.node_display_name = None - self.node_friendly_software_version = None - self.node_hcs_version = None - self.node_instance_id = None + self.node_status: Optional[Union[str, "_models.NodeStatus"]] = None + self.node_chassis_serial_number: Optional[str] = None + self.node_serial_number: Optional[str] = None + self.node_display_name: Optional[str] = None + self.node_friendly_software_version: Optional[str] = None + self.node_hcs_version: Optional[str] = None + self.node_instance_id: Optional[str] = None class NodeInfo(_serialization.Model): @@ -3799,10 +3722,9 @@ class NodeInfo(_serialization.Model): :ivar name: Node name. :vartype name: str :ivar type: Node type - Master/Worker. Known values are: "Invalid", "Master", and "Worker". - :vartype type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesNodeType + :vartype type: str or ~azure.mgmt.databoxedge.models.KubernetesNodeType :ivar ip_configuration: IP Configuration of the Kubernetes node. - :vartype ip_configuration: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesIPConfiguration] + :vartype ip_configuration: list[~azure.mgmt.databoxedge.models.KubernetesIPConfiguration] """ _validation = { @@ -3821,12 +3743,11 @@ def __init__( ) -> None: """ :keyword ip_configuration: IP Configuration of the Kubernetes node. - :paramtype ip_configuration: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.KubernetesIPConfiguration] + :paramtype ip_configuration: list[~azure.mgmt.databoxedge.models.KubernetesIPConfiguration] """ super().__init__(**kwargs) - self.name = None - self.type = None + self.name: Optional[str] = None + self.type: Optional[Union[str, "_models.KubernetesNodeType"]] = None self.ip_configuration = ip_configuration @@ -3836,7 +3757,7 @@ class NodeList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of Nodes. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Node] + :vartype value: list[~azure.mgmt.databoxedge.models.Node] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3856,7 +3777,7 @@ def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: :paramtype next_link: str """ super().__init__(**kwargs) - self.value = None + self.value: Optional[List["_models.Node"]] = None self.next_link = next_link @@ -3866,14 +3787,13 @@ class Operation(_serialization.Model): :ivar name: Name of the operation. :vartype name: str :ivar display: Properties displayed for the operation. - :vartype display: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OperationDisplay + :vartype display: ~azure.mgmt.databoxedge.models.OperationDisplay :ivar origin: Origin of the operation. :vartype origin: str :ivar is_data_action: Indicates whether the operation is a data action. :vartype is_data_action: bool :ivar service_specification: Service specification. - :vartype service_specification: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ServiceSpecification + :vartype service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification """ _attribute_map = { @@ -3898,14 +3818,13 @@ def __init__( :keyword name: Name of the operation. :paramtype name: str :keyword display: Properties displayed for the operation. - :paramtype display: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OperationDisplay + :paramtype display: ~azure.mgmt.databoxedge.models.OperationDisplay :keyword origin: Origin of the operation. :paramtype origin: str :keyword is_data_action: Indicates whether the operation is a data action. :paramtype is_data_action: bool :keyword service_specification: Service specification. - :paramtype service_specification: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ServiceSpecification + :paramtype service_specification: ~azure.mgmt.databoxedge.models.ServiceSpecification """ super().__init__(**kwargs) self.name = name @@ -3967,7 +3886,7 @@ class OperationsList(_serialization.Model): All required parameters must be populated in order to send to server. :ivar value: The value. Required. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Operation] + :vartype value: list[~azure.mgmt.databoxedge.models.Operation] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -3984,7 +3903,7 @@ class OperationsList(_serialization.Model): def __init__(self, *, value: List["_models.Operation"], next_link: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: The value. Required. - :paramtype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Operation] + :paramtype value: list[~azure.mgmt.databoxedge.models.Operation] :keyword next_link: Link to the next set of results. :paramtype next_link: str """ @@ -4005,28 +3924,26 @@ class Order(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: Order configured on ASE resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar contact_information: The contact details. - :vartype contact_information: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ContactDetails + :vartype contact_information: ~azure.mgmt.databoxedge.models.ContactDetails :ivar shipping_address: The shipping address. - :vartype shipping_address: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Address + :vartype shipping_address: ~azure.mgmt.databoxedge.models.Address :ivar current_status: Current status of the order. - :vartype current_status: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderStatus + :vartype current_status: ~azure.mgmt.databoxedge.models.OrderStatus :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderStatus] + :vartype order_history: list[~azure.mgmt.databoxedge.models.OrderStatus] :ivar serial_number: Serial number of the device. :vartype serial_number: str :ivar delivery_tracking_info: Tracking information for the package delivered to the customer whether it has an original or a replacement device. - :vartype delivery_tracking_info: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.TrackingInfo] + :vartype delivery_tracking_info: list[~azure.mgmt.databoxedge.models.TrackingInfo] :ivar return_tracking_info: Tracking information for the package returned from the customer whether it has an original or a replacement device. - :vartype return_tracking_info: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.TrackingInfo] + :vartype return_tracking_info: list[~azure.mgmt.databoxedge.models.TrackingInfo] :ivar shipment_type: ShipmentType of the order. Known values are: "NotApplicable", "ShippedToCustomer", and "SelfPickup". - :vartype shipment_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShipmentType + :vartype shipment_type: str or ~azure.mgmt.databoxedge.models.ShipmentType """ _validation = { @@ -4066,24 +3983,22 @@ def __init__( ) -> None: """ :keyword contact_information: The contact details. - :paramtype contact_information: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ContactDetails + :paramtype contact_information: ~azure.mgmt.databoxedge.models.ContactDetails :keyword shipping_address: The shipping address. - :paramtype shipping_address: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Address + :paramtype shipping_address: ~azure.mgmt.databoxedge.models.Address :keyword shipment_type: ShipmentType of the order. Known values are: "NotApplicable", "ShippedToCustomer", and "SelfPickup". - :paramtype shipment_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShipmentType + :paramtype shipment_type: str or ~azure.mgmt.databoxedge.models.ShipmentType """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.contact_information = contact_information self.shipping_address = shipping_address - self.current_status = None - self.order_history = None - self.serial_number = None - self.delivery_tracking_info = None - self.return_tracking_info = None + self.current_status: Optional["_models.OrderStatus"] = None + self.order_history: Optional[List["_models.OrderStatus"]] = None + self.serial_number: Optional[str] = None + self.delivery_tracking_info: Optional[List["_models.TrackingInfo"]] = None + self.return_tracking_info: Optional[List["_models.TrackingInfo"]] = None self.shipment_type = shipment_type @@ -4093,7 +4008,7 @@ class OrderList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :vartype value: list[~azure.mgmt.databoxedge.models.Order] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -4111,8 +4026,8 @@ class OrderList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.Order"]] = None + self.next_link: Optional[str] = None class OrderStatus(_serialization.Model): @@ -4127,13 +4042,13 @@ class OrderStatus(_serialization.Model): "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft", "AwaitingPickup", "PickupCompleted", and "AwaitingDrop". - :vartype status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderState + :vartype status: str or ~azure.mgmt.databoxedge.models.OrderState :ivar update_date_time: Time of status update. :vartype update_date_time: ~datetime.datetime :ivar comments: Comments related to this status change. :vartype comments: str :ivar tracking_information: Tracking information related to the state in the ordering flow. - :vartype tracking_information: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TrackingInfo + :vartype tracking_information: ~azure.mgmt.databoxedge.models.TrackingInfo :ivar additional_order_details: Dictionary to hold generic information which is not stored by the already existing properties. :vartype additional_order_details: dict[str, str] @@ -4163,16 +4078,16 @@ def __init__( "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", "AwaitingReturnShipment", "ShippedBack", "CollectedAtMicrosoft", "AwaitingPickup", "PickupCompleted", and "AwaitingDrop". - :paramtype status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.OrderState + :paramtype status: str or ~azure.mgmt.databoxedge.models.OrderState :keyword comments: Comments related to this status change. :paramtype comments: str """ super().__init__(**kwargs) self.status = status - self.update_date_time = None + self.update_date_time: Optional[datetime.datetime] = None self.comments = comments - self.tracking_information = None - self.additional_order_details = None + self.tracking_information: Optional["_models.TrackingInfo"] = None + self.additional_order_details: Optional[Dict[str, str]] = None class PeriodicTimerEventTrigger(Trigger): @@ -4189,14 +4104,13 @@ class PeriodicTimerEventTrigger(Trigger): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: Trigger in DataBoxEdge Resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar kind: Trigger Kind. Required. Known values are: "FileEvent" and "PeriodicTimerEvent". - :vartype kind: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.TriggerEventType + :vartype kind: str or ~azure.mgmt.databoxedge.models.TriggerEventType :ivar source_info: Periodic timer details. Required. - :vartype source_info: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PeriodicTimerSourceInfo + :vartype source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo :ivar sink_info: Role Sink information. Required. - :vartype sink_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleSinkInfo + :vartype sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo :ivar custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -4235,10 +4149,9 @@ def __init__( ) -> None: """ :keyword source_info: Periodic timer details. Required. - :paramtype source_info: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.PeriodicTimerSourceInfo + :paramtype source_info: ~azure.mgmt.databoxedge.models.PeriodicTimerSourceInfo :keyword sink_info: Role Sink information. Required. - :paramtype sink_info: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RoleSinkInfo + :paramtype sink_info: ~azure.mgmt.databoxedge.models.RoleSinkInfo :keyword custom_context_tag: A custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. @@ -4364,7 +4277,7 @@ class ResourceIdentity(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar type: Identity type. Known values are: "None", "SystemAssigned", and "UserAssigned". - :vartype type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MsiIdentityType + :vartype type: str or ~azure.mgmt.databoxedge.models.MsiIdentityType :ivar principal_id: Service Principal Id backing the Msi. :vartype principal_id: str :ivar tenant_id: Home Tenant Id. @@ -4385,12 +4298,12 @@ class ResourceIdentity(_serialization.Model): def __init__(self, *, type: Optional[Union[str, "_models.MsiIdentityType"]] = None, **kwargs: Any) -> None: """ :keyword type: Identity type. Known values are: "None", "SystemAssigned", and "UserAssigned". - :paramtype type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MsiIdentityType + :paramtype type: str or ~azure.mgmt.databoxedge.models.MsiIdentityType """ super().__init__(**kwargs) self.type = type - self.principal_id = None - self.tenant_id = None + self.principal_id: Optional[str] = None + self.tenant_id: Optional[str] = None class ResourceMoveDetails(_serialization.Model): @@ -4398,8 +4311,7 @@ class ResourceMoveDetails(_serialization.Model): :ivar operation_in_progress: Denotes whether move operation is in progress. Known values are: "None", "ResourceMoveInProgress", and "ResourceMoveFailed". - :vartype operation_in_progress: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceMoveStatus + :vartype operation_in_progress: str or ~azure.mgmt.databoxedge.models.ResourceMoveStatus :ivar operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to finish. :vartype operation_in_progress_lock_timeout_in_utc: ~datetime.datetime @@ -4420,8 +4332,7 @@ def __init__( """ :keyword operation_in_progress: Denotes whether move operation is in progress. Known values are: "None", "ResourceMoveInProgress", and "ResourceMoveFailed". - :paramtype operation_in_progress: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceMoveStatus + :paramtype operation_in_progress: str or ~azure.mgmt.databoxedge.models.ResourceMoveStatus :keyword operation_in_progress_lock_timeout_in_utc: Denotes the timeout of the operation to finish. :paramtype operation_in_progress_lock_timeout_in_utc: ~datetime.datetime @@ -4439,7 +4350,7 @@ class ResourceTypeSku(_serialization.Model): :ivar resource_type: The resource type. :vartype resource_type: str :ivar skus: The skus. - :vartype skus: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuInformation] + :vartype skus: list[~azure.mgmt.databoxedge.models.SkuInformation] """ _validation = { @@ -4455,8 +4366,8 @@ class ResourceTypeSku(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.resource_type = None - self.skus = None + self.resource_type: Optional[str] = None + self.skus: Optional[List["_models.SkuInformation"]] = None class RoleList(_serialization.Model): @@ -4465,7 +4376,7 @@ class RoleList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] + :vartype value: list[~azure.mgmt.databoxedge.models.Role] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -4483,8 +4394,8 @@ class RoleList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.Role"]] = None + self.next_link: Optional[str] = None class RoleSinkInfo(_serialization.Model): @@ -4517,8 +4428,7 @@ class Secret(_serialization.Model): """Holds device secret either as a KeyVault reference or as an encrypted value. :ivar encrypted_secret: Encrypted (using device public key) secret value. - :vartype encrypted_secret: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :vartype encrypted_secret: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret :ivar key_vault_id: Id of the Key-Vault where secret is stored (ex: secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). :vartype key_vault_id: str @@ -4538,8 +4448,7 @@ def __init__( ) -> None: """ :keyword encrypted_secret: Encrypted (using device public key) secret value. - :paramtype encrypted_secret: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :paramtype encrypted_secret: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret :keyword key_vault_id: Id of the Key-Vault where secret is stored (ex: secrets/AuthClientSecret/82ef4346187a4033a10d629cde07d740). :paramtype key_vault_id: str @@ -4566,8 +4475,7 @@ class SecuritySettings(ARMBaseModel): using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. Required. - :vartype device_admin_password: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :vartype device_admin_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret """ _validation = { @@ -4590,8 +4498,7 @@ def __init__(self, *, device_admin_password: "_models.AsymmetricEncryptedSecret" using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. Required. - :paramtype device_admin_password: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :paramtype device_admin_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret """ super().__init__(**kwargs) self.device_admin_password = device_admin_password @@ -4601,8 +4508,7 @@ class ServiceSpecification(_serialization.Model): """Service specification. :ivar metric_specifications: Metric specification as defined by shoebox. - :vartype metric_specifications: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricSpecificationV1] + :vartype metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] """ _attribute_map = { @@ -4614,8 +4520,7 @@ def __init__( ) -> None: """ :keyword metric_specifications: Metric specification as defined by shoebox. - :paramtype metric_specifications: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MetricSpecificationV1] + :paramtype metric_specifications: list[~azure.mgmt.databoxedge.models.MetricSpecificationV1] """ super().__init__(**kwargs) self.metric_specifications = metric_specifications @@ -4635,37 +4540,32 @@ class Share(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: Share on ASE device. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar description: Description for the share. :vartype description: str :ivar share_status: Current status of the share. Required. Known values are: "Offline", "Unknown", "OK", "Updating", and "NeedsAttention". - :vartype share_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareStatus + :vartype share_status: str or ~azure.mgmt.databoxedge.models.ShareStatus :ivar monitoring_status: Current monitoring status of the share. Required. Known values are: "Enabled" and "Disabled". - :vartype monitoring_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringStatus + :vartype monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus :ivar azure_container_info: Azure container mapping for the share. - :vartype azure_container_info: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerInfo + :vartype azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo :ivar access_protocol: Access protocol to be used by the share. Required. Known values are: "SMB" and "NFS". - :vartype access_protocol: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareAccessProtocol + :vartype access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol :ivar user_access_rights: Mapping of users and corresponding access rights on the share (required for SMB protocol). - :vartype user_access_rights: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.UserAccessRight] + :vartype user_access_rights: list[~azure.mgmt.databoxedge.models.UserAccessRight] :ivar client_access_rights: List of IP addresses and corresponding access rights on the share(required for NFS protocol). - :vartype client_access_rights: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ClientAccessRight] + :vartype client_access_rights: list[~azure.mgmt.databoxedge.models.ClientAccessRight] :ivar refresh_details: Details of the refresh job on this share. - :vartype refresh_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RefreshDetails + :vartype refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MountPointMap] + :vartype share_mappings: list[~azure.mgmt.databoxedge.models.MountPointMap] :ivar data_policy: Data policy of the share. Known values are: "Cloud" and "Local". - :vartype data_policy: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataPolicy + :vartype data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy """ _validation = { @@ -4715,33 +4615,28 @@ def __init__( :paramtype description: str :keyword share_status: Current status of the share. Required. Known values are: "Offline", "Unknown", "OK", "Updating", and "NeedsAttention". - :paramtype share_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareStatus + :paramtype share_status: str or ~azure.mgmt.databoxedge.models.ShareStatus :keyword monitoring_status: Current monitoring status of the share. Required. Known values are: "Enabled" and "Disabled". - :paramtype monitoring_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringStatus + :paramtype monitoring_status: str or ~azure.mgmt.databoxedge.models.MonitoringStatus :keyword azure_container_info: Azure container mapping for the share. - :paramtype azure_container_info: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AzureContainerInfo + :paramtype azure_container_info: ~azure.mgmt.databoxedge.models.AzureContainerInfo :keyword access_protocol: Access protocol to be used by the share. Required. Known values are: "SMB" and "NFS". - :paramtype access_protocol: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareAccessProtocol + :paramtype access_protocol: str or ~azure.mgmt.databoxedge.models.ShareAccessProtocol :keyword user_access_rights: Mapping of users and corresponding access rights on the share (required for SMB protocol). - :paramtype user_access_rights: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.UserAccessRight] + :paramtype user_access_rights: list[~azure.mgmt.databoxedge.models.UserAccessRight] :keyword client_access_rights: List of IP addresses and corresponding access rights on the share(required for NFS protocol). - :paramtype client_access_rights: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ClientAccessRight] + :paramtype client_access_rights: list[~azure.mgmt.databoxedge.models.ClientAccessRight] :keyword refresh_details: Details of the refresh job on this share. - :paramtype refresh_details: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.RefreshDetails + :paramtype refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails :keyword data_policy: Data policy of the share. Known values are: "Cloud" and "Local". - :paramtype data_policy: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataPolicy + :paramtype data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.description = description self.share_status = share_status self.monitoring_status = monitoring_status @@ -4750,7 +4645,7 @@ def __init__( self.user_access_rights = user_access_rights self.client_access_rights = client_access_rights self.refresh_details = refresh_details - self.share_mappings = None + self.share_mappings: Optional[List["_models.MountPointMap"]] = None self.data_policy = data_policy @@ -4764,7 +4659,7 @@ class ShareAccessRight(_serialization.Model): :vartype share_id: str :ivar access_type: Type of access to be allowed on the share for this user. Required. Known values are: "Change", "Read", and "Custom". - :vartype access_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareAccessType + :vartype access_type: str or ~azure.mgmt.databoxedge.models.ShareAccessType """ _validation = { @@ -4783,8 +4678,7 @@ def __init__(self, *, share_id: str, access_type: Union[str, "_models.ShareAcces :paramtype share_id: str :keyword access_type: Type of access to be allowed on the share for this user. Required. Known values are: "Change", "Read", and "Custom". - :paramtype access_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareAccessType + :paramtype access_type: str or ~azure.mgmt.databoxedge.models.ShareAccessType """ super().__init__(**kwargs) self.share_id = share_id @@ -4797,7 +4691,7 @@ class ShareList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] + :vartype value: list[~azure.mgmt.databoxedge.models.Share] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -4815,8 +4709,8 @@ class ShareList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.Share"]] = None + self.next_link: Optional[str] = None class Sku(_serialization.Model): @@ -4827,9 +4721,9 @@ class Sku(_serialization.Model): "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", and "Management". - :vartype name: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuName + :vartype name: str or ~azure.mgmt.databoxedge.models.SkuName :ivar tier: The SKU tier. This is based on the SKU name. "Standard" - :vartype tier: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuTier + :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier """ _attribute_map = { @@ -4850,9 +4744,9 @@ def __init__( "TDC", "TCA_Small", "GPU", "TCA_Large", "EdgeP_Base", "EdgeP_High", "EdgePR_Base", "EdgePR_Base_UPS", "EP2_64_1VPU_W", "EP2_128_1T4_Mx1_W", "EP2_256_2T4_W", "EdgeMR_Mini", "RCA_Small", "RCA_Large", "RDC", and "Management". - :paramtype name: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuName + :paramtype name: str or ~azure.mgmt.databoxedge.models.SkuName :keyword tier: The SKU tier. This is based on the SKU name. "Standard" - :paramtype tier: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuTier + :paramtype tier: str or ~azure.mgmt.databoxedge.models.SkuTier """ super().__init__(**kwargs) self.name = name @@ -4883,8 +4777,8 @@ class SkuCapability(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.value = None + self.name: Optional[str] = None + self.value: Optional[str] = None class SkuCost(_serialization.Model): @@ -4915,9 +4809,9 @@ class SkuCost(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.meter_id = None - self.quantity = None - self.extended_unit = None + self.meter_id: Optional[str] = None + self.quantity: Optional[int] = None + self.extended_unit: Optional[str] = None class SkuInformation(_serialization.Model): @@ -4934,12 +4828,11 @@ class SkuInformation(_serialization.Model): :ivar family: The Sku family. :vartype family: str :ivar costs: The pricing info of the Sku. - :vartype costs: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuCost] + :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] :ivar locations: The locations where Sku is available. :vartype locations: list[str] :ivar location_info: The locations where Sku is available with zones and sites info. - :vartype location_info: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.SkuLocationInfo] + :vartype location_info: list[~azure.mgmt.databoxedge.models.SkuLocationInfo] :ivar required_quota_ids: The required quotaIds for the sku to be available. :vartype required_quota_ids: list[str] :ivar required_features: The required features for the sku to be available. @@ -4973,15 +4866,15 @@ class SkuInformation(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.tier = None - self.kind = None - self.family = None - self.costs = None - self.locations = None - self.location_info = None - self.required_quota_ids = None - self.required_features = None + self.name: Optional[str] = None + self.tier: Optional[str] = None + self.kind: Optional[str] = None + self.family: Optional[str] = None + self.costs: Optional[List["_models.SkuCost"]] = None + self.locations: Optional[List[str]] = None + self.location_info: Optional[List["_models.SkuLocationInfo"]] = None + self.required_quota_ids: Optional[List[str]] = None + self.required_features: Optional[List[str]] = None class SkuInformationList(_serialization.Model): @@ -4990,7 +4883,7 @@ class SkuInformationList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of ResourceTypeSku objects. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ResourceTypeSku] + :vartype value: list[~azure.mgmt.databoxedge.models.ResourceTypeSku] :ivar next_link: Links to the next set of results. :vartype next_link: str """ @@ -5008,8 +4901,8 @@ class SkuInformationList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.ResourceTypeSku"]] = None + self.next_link: Optional[str] = None class SkuLocationInfo(_serialization.Model): @@ -5040,9 +4933,9 @@ class SkuLocationInfo(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.location = None - self.zones = None - self.sites = None + self.location: Optional[str] = None + self.zones: Optional[List[str]] = None + self.sites: Optional[List[str]] = None class StorageAccount(ARMBaseModel): @@ -5059,16 +4952,15 @@ class StorageAccount(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: StorageAccount object on ASE device. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar description: Description for the storage Account. :vartype description: str :ivar storage_account_status: Current status of the storage account. Known values are: "OK", "Offline", "Unknown", "Updating", and "NeedsAttention". - :vartype storage_account_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountStatus + :vartype storage_account_status: str or ~azure.mgmt.databoxedge.models.StorageAccountStatus :ivar data_policy: Data policy of the storage Account. Required. Known values are: "Cloud" and "Local". - :vartype data_policy: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataPolicy + :vartype data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy :ivar storage_account_credential_id: Storage Account Credential Id. :vartype storage_account_credential_id: str :ivar blob_endpoint: BlobEndpoint of Storage Account. @@ -5115,22 +5007,21 @@ def __init__( :paramtype description: str :keyword storage_account_status: Current status of the storage account. Known values are: "OK", "Offline", "Unknown", "Updating", and "NeedsAttention". - :paramtype storage_account_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountStatus + :paramtype storage_account_status: str or ~azure.mgmt.databoxedge.models.StorageAccountStatus :keyword data_policy: Data policy of the storage Account. Required. Known values are: "Cloud" and "Local". - :paramtype data_policy: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataPolicy + :paramtype data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy :keyword storage_account_credential_id: Storage Account Credential Id. :paramtype storage_account_credential_id: str """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.description = description self.storage_account_status = storage_account_status self.data_policy = data_policy self.storage_account_credential_id = storage_account_credential_id - self.blob_endpoint = None - self.container_count = None + self.blob_endpoint: Optional[str] = None + self.container_count: Optional[int] = None class StorageAccountCredential(ARMBaseModel): @@ -5147,25 +5038,24 @@ class StorageAccountCredential(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: StorageAccountCredential object. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar alias: Alias for the storage account. Required. :vartype alias: str :ivar user_name: Username for the storage account. :vartype user_name: str :ivar account_key: Encrypted storage key. - :vartype account_key: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :vartype account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret :ivar connection_string: Connection string for the storage account. Use this string if username and account key are not specified. :vartype connection_string: str :ivar ssl_status: Signifies whether SSL needs to be enabled or not. Required. Known values are: "Enabled" and "Disabled". - :vartype ssl_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SSLStatus + :vartype ssl_status: str or ~azure.mgmt.databoxedge.models.SSLStatus :ivar blob_domain_name: Blob end point for private clouds. :vartype blob_domain_name: str :ivar account_type: Type of storage accessed on the storage account. Required. Known values are: "GeneralPurposeStorage" and "BlobStorage". - :vartype account_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AccountType + :vartype account_type: str or ~azure.mgmt.databoxedge.models.AccountType :ivar storage_account_id: Id of the storage account. :vartype storage_account_id: str """ @@ -5214,24 +5104,23 @@ def __init__( :keyword user_name: Username for the storage account. :paramtype user_name: str :keyword account_key: Encrypted storage key. - :paramtype account_key: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :paramtype account_key: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret :keyword connection_string: Connection string for the storage account. Use this string if username and account key are not specified. :paramtype connection_string: str :keyword ssl_status: Signifies whether SSL needs to be enabled or not. Required. Known values are: "Enabled" and "Disabled". - :paramtype ssl_status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SSLStatus + :paramtype ssl_status: str or ~azure.mgmt.databoxedge.models.SSLStatus :keyword blob_domain_name: Blob end point for private clouds. :paramtype blob_domain_name: str :keyword account_type: Type of storage accessed on the storage account. Required. Known values are: "GeneralPurposeStorage" and "BlobStorage". - :paramtype account_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AccountType + :paramtype account_type: str or ~azure.mgmt.databoxedge.models.AccountType :keyword storage_account_id: Id of the storage account. :paramtype storage_account_id: str """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.alias = alias self.user_name = user_name self.account_key = account_key @@ -5248,8 +5137,7 @@ class StorageAccountCredentialList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The value. - :vartype value: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] + :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccountCredential] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -5267,8 +5155,8 @@ class StorageAccountCredentialList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.StorageAccountCredential"]] = None + self.next_link: Optional[str] = None class StorageAccountList(_serialization.Model): @@ -5277,7 +5165,7 @@ class StorageAccountList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of storageAccounts. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] + :vartype value: list[~azure.mgmt.databoxedge.models.StorageAccount] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -5295,8 +5183,8 @@ class StorageAccountList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.StorageAccount"]] = None + self.next_link: Optional[str] = None class SubscriptionRegisteredFeatures(_serialization.Model): @@ -5329,8 +5217,7 @@ class SymmetricKey(_serialization.Model): """Symmetric key for authentication. :ivar connection_string: Connection string based on the symmetric key. - :vartype connection_string: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :vartype connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret """ _attribute_map = { @@ -5342,8 +5229,7 @@ def __init__( ) -> None: """ :keyword connection_string: Connection string based on the symmetric key. - :paramtype connection_string: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :paramtype connection_string: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret """ super().__init__(**kwargs) self.connection_string = connection_string @@ -5356,16 +5242,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.databoxedge.v2021_02_01_preview.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.databoxedge.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.databoxedge.v2021_02_01_preview.models.CreatedByType + :vartype last_modified_by_type: str or ~azure.mgmt.databoxedge.models.CreatedByType :ivar last_modified_at: The type of identity that last modified the resource. :vartype last_modified_at: ~datetime.datetime """ @@ -5395,16 +5279,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.databoxedge.v2021_02_01_preview.models.CreatedByType + :paramtype created_by_type: str or ~azure.mgmt.databoxedge.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.databoxedge.v2021_02_01_preview.models.CreatedByType + :paramtype last_modified_by_type: str or ~azure.mgmt.databoxedge.models.CreatedByType :keyword last_modified_at: The type of identity that last modified the resource. :paramtype last_modified_at: ~datetime.datetime """ @@ -5469,7 +5351,7 @@ class TriggerList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] + :vartype value: list[~azure.mgmt.databoxedge.models.Trigger] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -5487,8 +5369,8 @@ class TriggerList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.Trigger"]] = None + self.next_link: Optional[str] = None class UpdateDetails(_serialization.Model): @@ -5500,18 +5382,17 @@ class UpdateDetails(_serialization.Model): :vartype update_size: float :ivar update_type: Type of the Update. Known values are: "Software", "Kubernetes", and "Firmware". - :vartype update_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateType + :vartype update_type: str or ~azure.mgmt.databoxedge.models.UpdateType :ivar target_version: Target Version number. :vartype target_version: str :ivar estimated_install_time_in_mins: Estimated Install Time for the update. :vartype estimated_install_time_in_mins: int :ivar reboot_behavior: Indicates if updates are available and at least one of the updates needs a reboot. Known values are: "NeverReboots", "RequiresReboot", and "RequestReboot". - :vartype reboot_behavior: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.InstallRebootBehavior + :vartype reboot_behavior: str or ~azure.mgmt.databoxedge.models.InstallRebootBehavior :ivar status: Status of the update. Known values are: "DownloadPending", "DownloadStarted", "DownloadCompleted", "InstallStarted", and "InstallCompleted". - :vartype status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateStatus + :vartype status: str or ~azure.mgmt.databoxedge.models.UpdateStatus """ _attribute_map = { @@ -5543,18 +5424,17 @@ def __init__( :paramtype update_size: float :keyword update_type: Type of the Update. Known values are: "Software", "Kubernetes", and "Firmware". - :paramtype update_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateType + :paramtype update_type: str or ~azure.mgmt.databoxedge.models.UpdateType :keyword target_version: Target Version number. :paramtype target_version: str :keyword estimated_install_time_in_mins: Estimated Install Time for the update. :paramtype estimated_install_time_in_mins: int :keyword reboot_behavior: Indicates if updates are available and at least one of the updates needs a reboot. Known values are: "NeverReboots", "RequiresReboot", and "RequestReboot". - :paramtype reboot_behavior: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.InstallRebootBehavior + :paramtype reboot_behavior: str or ~azure.mgmt.databoxedge.models.InstallRebootBehavior :keyword status: Status of the update. Known values are: "DownloadPending", "DownloadStarted", "DownloadCompleted", "InstallStarted", and "InstallCompleted". - :paramtype status: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateStatus + :paramtype status: str or ~azure.mgmt.databoxedge.models.UpdateStatus """ super().__init__(**kwargs) self.update_title = update_title @@ -5573,8 +5453,7 @@ class UpdateDownloadProgress(_serialization.Model): :ivar download_phase: The download phase. Known values are: "Unknown", "Initializing", "Downloading", and "Verifying". - :vartype download_phase: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DownloadPhase + :vartype download_phase: str or ~azure.mgmt.databoxedge.models.DownloadPhase :ivar percent_complete: Percentage of completion. :vartype percent_complete: int :ivar total_bytes_to_download: Total bytes to download. @@ -5608,12 +5487,12 @@ class UpdateDownloadProgress(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.download_phase = None - self.percent_complete = None - self.total_bytes_to_download = None - self.total_bytes_downloaded = None - self.number_of_updates_to_download = None - self.number_of_updates_downloaded = None + self.download_phase: Optional[Union[str, "_models.DownloadPhase"]] = None + self.percent_complete: Optional[int] = None + self.total_bytes_to_download: Optional[float] = None + self.total_bytes_downloaded: Optional[float] = None + self.number_of_updates_to_download: Optional[int] = None + self.number_of_updates_downloaded: Optional[int] = None class UpdateInstallProgress(_serialization.Model): @@ -5644,9 +5523,9 @@ class UpdateInstallProgress(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.percent_complete = None - self.number_of_updates_to_install = None - self.number_of_updates_installed = None + self.percent_complete: Optional[int] = None + self.number_of_updates_to_install: Optional[int] = None + self.number_of_updates_installed: Optional[int] = None class UpdateSummary(ARMBaseModel): @@ -5661,7 +5540,7 @@ class UpdateSummary(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: UpdateSummary Result. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar device_version_number: The current version of the device in format: 1.2.17312.13.",. :vartype device_version_number: str :ivar friendly_device_version_name: The current version of the device in text format. @@ -5679,8 +5558,7 @@ class UpdateSummary(ARMBaseModel): :vartype last_completed_download_job_id: str :ivar last_download_job_status: JobStatus of the last ran download job. Known values are: "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", and "Scheduled". - :vartype last_download_job_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobStatus + :vartype last_download_job_status: str or ~azure.mgmt.databoxedge.models.JobStatus :ivar last_completed_install_job_date_time: The time when the last Install job was completed (success/cancelled/failed) on the appliance. :vartype last_completed_install_job_date_time: ~datetime.datetime @@ -5689,8 +5567,7 @@ class UpdateSummary(ARMBaseModel): :vartype last_completed_install_job_id: str :ivar last_install_job_status: JobStatus of the last ran install job. Known values are: "Invalid", "Running", "Succeeded", "Failed", "Canceled", "Paused", and "Scheduled". - :vartype last_install_job_status: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.JobStatus + :vartype last_install_job_status: str or ~azure.mgmt.databoxedge.models.JobStatus :ivar total_number_of_updates_available: The number of updates available for the current device version as per the last device scan. :vartype total_number_of_updates_available: int @@ -5700,12 +5577,10 @@ class UpdateSummary(ARMBaseModel): :vartype total_number_of_updates_pending_install: int :ivar reboot_behavior: Indicates if updates are available and at least one of the updates needs a reboot. Known values are: "NeverReboots", "RequiresReboot", and "RequestReboot". - :vartype reboot_behavior: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.InstallRebootBehavior + :vartype reboot_behavior: str or ~azure.mgmt.databoxedge.models.InstallRebootBehavior :ivar ongoing_update_operation: The current update operation. Known values are: "None", "Scan", "Download", and "Install". - :vartype ongoing_update_operation: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateOperation + :vartype ongoing_update_operation: str or ~azure.mgmt.databoxedge.models.UpdateOperation :ivar in_progress_download_job_id: The job ID of the download job in progress. :vartype in_progress_download_job_id: str :ivar in_progress_install_job_id: The job ID of the install job in progress. @@ -5719,7 +5594,7 @@ class UpdateSummary(ARMBaseModel): :ivar update_titles: The list of updates available for install. :vartype update_titles: list[str] :ivar updates: The list of updates available for install. - :vartype updates: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateDetails] + :vartype updates: list[~azure.mgmt.databoxedge.models.UpdateDetails] :ivar total_update_size_in_bytes: The total size of updates available for download in bytes. :vartype total_update_size_in_bytes: float :ivar total_time_in_minutes: The total time in Minutes. @@ -5821,30 +5696,30 @@ def __init__( # pylint: disable=too-many-locals :paramtype last_completed_scan_job_date_time: ~datetime.datetime """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.device_version_number = device_version_number self.friendly_device_version_name = friendly_device_version_name self.device_last_scanned_date_time = device_last_scanned_date_time self.last_completed_scan_job_date_time = last_completed_scan_job_date_time - self.last_completed_download_job_date_time = None - self.last_completed_download_job_id = None - self.last_download_job_status = None - self.last_completed_install_job_date_time = None - self.last_completed_install_job_id = None - self.last_install_job_status = None - self.total_number_of_updates_available = None - self.total_number_of_updates_pending_download = None - self.total_number_of_updates_pending_install = None - self.reboot_behavior = None - self.ongoing_update_operation = None - self.in_progress_download_job_id = None - self.in_progress_install_job_id = None - self.in_progress_download_job_started_date_time = None - self.in_progress_install_job_started_date_time = None - self.update_titles = None - self.updates = None - self.total_update_size_in_bytes = None - self.total_time_in_minutes = None + self.last_completed_download_job_date_time: Optional[datetime.datetime] = None + self.last_completed_download_job_id: Optional[str] = None + self.last_download_job_status: Optional[Union[str, "_models.JobStatus"]] = None + self.last_completed_install_job_date_time: Optional[datetime.datetime] = None + self.last_completed_install_job_id: Optional[str] = None + self.last_install_job_status: Optional[Union[str, "_models.JobStatus"]] = None + self.total_number_of_updates_available: Optional[int] = None + self.total_number_of_updates_pending_download: Optional[int] = None + self.total_number_of_updates_pending_install: Optional[int] = None + self.reboot_behavior: Optional[Union[str, "_models.InstallRebootBehavior"]] = None + self.ongoing_update_operation: Optional[Union[str, "_models.UpdateOperation"]] = None + self.in_progress_download_job_id: Optional[str] = None + self.in_progress_install_job_id: Optional[str] = None + self.in_progress_download_job_started_date_time: Optional[datetime.datetime] = None + self.in_progress_install_job_started_date_time: Optional[datetime.datetime] = None + self.update_titles: Optional[List[str]] = None + self.updates: Optional[List["_models.UpdateDetails"]] = None + self.total_update_size_in_bytes: Optional[float] = None + self.total_time_in_minutes: Optional[int] = None class UploadCertificateRequest(_serialization.Model): @@ -5854,8 +5729,7 @@ class UploadCertificateRequest(_serialization.Model): :ivar authentication_type: The authentication type. Known values are: "Invalid" and "AzureActiveDirectory". - :vartype authentication_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AuthenticationType + :vartype authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType :ivar certificate: The base64 encoded certificate raw data. Required. :vartype certificate: str """ @@ -5879,8 +5753,7 @@ def __init__( """ :keyword authentication_type: The authentication type. Known values are: "Invalid" and "AzureActiveDirectory". - :paramtype authentication_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AuthenticationType + :paramtype authentication_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType :keyword certificate: The base64 encoded certificate raw data. Required. :paramtype certificate: str """ @@ -5896,8 +5769,7 @@ class UploadCertificateResponse(_serialization.Model): :ivar auth_type: Specifies authentication type. Known values are: "Invalid" and "AzureActiveDirectory". - :vartype auth_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AuthenticationType + :vartype auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType :ivar resource_id: The resource ID of the Data Box Edge/Gateway device. :vartype resource_id: str :ivar aad_authority: Azure Active Directory tenant authority. @@ -5940,18 +5812,17 @@ def __init__(self, *, auth_type: Optional[Union[str, "_models.AuthenticationType """ :keyword auth_type: Specifies authentication type. Known values are: "Invalid" and "AzureActiveDirectory". - :paramtype auth_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AuthenticationType + :paramtype auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType """ super().__init__(**kwargs) self.auth_type = auth_type - self.resource_id = None - self.aad_authority = None - self.aad_tenant_id = None - self.service_principal_client_id = None - self.service_principal_object_id = None - self.azure_management_endpoint_audience = None - self.aad_audience = None + self.resource_id: Optional[str] = None + self.aad_authority: Optional[str] = None + self.aad_tenant_id: Optional[str] = None + self.service_principal_client_id: Optional[str] = None + self.service_principal_object_id: Optional[str] = None + self.azure_management_endpoint_audience: Optional[str] = None + self.aad_audience: Optional[str] = None class User(ARMBaseModel): @@ -5966,16 +5837,14 @@ class User(ARMBaseModel): :ivar type: The hierarchical type of the object. :vartype type: str :ivar system_data: User in DataBoxEdge Resource. - :vartype system_data: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.databoxedge.models.SystemData :ivar encrypted_password: The password details. - :vartype encrypted_password: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :vartype encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret :ivar share_access_rights: List of shares that the user has rights on. This field should not be specified during user creation. - :vartype share_access_rights: - list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareAccessRight] + :vartype share_access_rights: list[~azure.mgmt.databoxedge.models.ShareAccessRight] :ivar user_type: Type of the user. Known values are: "Share", "LocalManagement", and "ARM". - :vartype user_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UserType + :vartype user_type: str or ~azure.mgmt.databoxedge.models.UserType """ _validation = { @@ -6005,15 +5874,14 @@ def __init__( ) -> None: """ :keyword encrypted_password: The password details. - :paramtype encrypted_password: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.AsymmetricEncryptedSecret + :paramtype encrypted_password: ~azure.mgmt.databoxedge.models.AsymmetricEncryptedSecret :keyword user_type: Type of the user. Known values are: "Share", "LocalManagement", and "ARM". - :paramtype user_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UserType + :paramtype user_type: str or ~azure.mgmt.databoxedge.models.UserType """ super().__init__(**kwargs) - self.system_data = None + self.system_data: Optional["_models.SystemData"] = None self.encrypted_password = encrypted_password - self.share_access_rights = None + self.share_access_rights: Optional[List["_models.ShareAccessRight"]] = None self.user_type = user_type @@ -6026,7 +5894,7 @@ class UserAccessRight(_serialization.Model): :vartype user_id: str :ivar access_type: Type of access to be allowed for the user. Required. Known values are: "Change", "Read", and "Custom". - :vartype access_type: str or ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareAccessType + :vartype access_type: str or ~azure.mgmt.databoxedge.models.ShareAccessType """ _validation = { @@ -6045,8 +5913,7 @@ def __init__(self, *, user_id: str, access_type: Union[str, "_models.ShareAccess :paramtype user_id: str :keyword access_type: Type of access to be allowed for the user. Required. Known values are: "Change", "Read", and "Custom". - :paramtype access_type: str or - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.ShareAccessType + :paramtype access_type: str or ~azure.mgmt.databoxedge.models.ShareAccessType """ super().__init__(**kwargs) self.user_id = user_id @@ -6059,7 +5926,7 @@ class UserList(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] + :vartype value: list[~azure.mgmt.databoxedge.models.User] :ivar next_link: Link to the next set of results. :vartype next_link: str """ @@ -6077,5 +5944,5 @@ class UserList(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.User"]] = None + self.next_link: Optional[str] = None diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_patch.py similarity index 61% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_patch.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_patch.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/__init__.py similarity index 100% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/__init__.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/__init__.py diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_addons_operations.py similarity index 91% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_addons_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_addons_operations.py index 63de6d9a32f4..1a3a0c28fe14 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_addons_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_addons_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -56,7 +55,7 @@ def build_list_by_role_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "roleName": _SERIALIZER.url("role_name", role_name, "str"), @@ -88,7 +87,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "roleName": _SERIALIZER.url("role_name", role_name, "str"), @@ -122,7 +121,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "roleName": _SERIALIZER.url("role_name", role_name, "str"), @@ -157,7 +156,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/addons/{addonName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "roleName": _SERIALIZER.url("role_name", role_name, "str"), @@ -183,24 +182,25 @@ class AddonsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`addons` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_role( self, device_name: str, role_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Addon"]: + ) -> ItemPaged["_models.Addon"]: """Lists all the addons configured in the role. :param device_name: The device name. Required. @@ -210,15 +210,13 @@ def list_by_role( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Addon or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.Addon] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AddonList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -252,7 +250,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -299,7 +297,7 @@ def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Addon or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon + :rtype: ~azure.mgmt.databoxedge.models.Addon :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -313,9 +311,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Addon] = kwargs.pop("cls", None) _request = build_get_request( @@ -368,9 +364,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -443,12 +437,12 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param addon: The addon properties. Required. - :type addon: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon + :type addon: ~azure.mgmt.databoxedge.models.Addon :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Addon or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Addon] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -480,7 +474,7 @@ def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Addon or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Addon] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -505,17 +499,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param addon: The addon properties. Is either a Addon type or a IO[bytes] type. Required. - :type addon: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon or IO[bytes] + :type addon: ~azure.mgmt.databoxedge.models.Addon or IO[bytes] :return: An instance of LROPoller that returns either Addon or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Addon] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Addon] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.Addon] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -575,9 +567,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_request( @@ -636,9 +626,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_alerts_operations.py similarity index 88% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_alerts_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_alerts_operations.py index c31e5f085b4a..2352d28f97f3 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_alerts_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # 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 +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,14 +43,14 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -75,14 +74,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -107,24 +106,25 @@ class AlertsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`alerts` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Alert"]: + ) -> ItemPaged["_models.Alert"]: """Gets all the alerts for a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. @@ -132,13 +132,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Alert or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Alert] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.Alert] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -171,7 +171,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -216,7 +216,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Alert or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Alert + :rtype: ~azure.mgmt.databoxedge.models.Alert :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -230,7 +230,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Alert] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_available_skus_operations.py similarity index 81% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_available_skus_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_available_skus_operations.py index ba917b914fc6..535cb4fb3247 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_available_skus_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_available_skus_operations.py @@ -5,10 +5,11 @@ # 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 +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -68,37 +66,35 @@ class AvailableSkusOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`available_skus` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.DataBoxEdgeSku"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.DataBoxEdgeSku"]: """List all the available Skus and information related to them. List all the available Skus and information related to them. :return: An iterator like instance of either DataBoxEdgeSku or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeSku] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.DataBoxEdgeSku] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeSkuList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -129,7 +125,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_bandwidth_schedules_operations.py similarity index 91% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_bandwidth_schedules_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_bandwidth_schedules_operations.py index fb7b2d38adb5..5156701784f0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_bandwidth_schedules_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -80,14 +79,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -112,7 +111,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +119,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -147,14 +146,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -179,24 +178,25 @@ class BandwidthSchedulesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`bandwidth_schedules` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.BandwidthSchedule"]: + ) -> ItemPaged["_models.BandwidthSchedule"]: """Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. @@ -204,14 +204,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either BandwidthSchedule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BandwidthSchedulesList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -244,7 +243,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -287,7 +286,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: BandwidthSchedule or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule + :rtype: ~azure.mgmt.databoxedge.models.BandwidthSchedule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -301,7 +300,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BandwidthSchedule] = kwargs.pop("cls", None) _request = build_get_request( @@ -352,7 +351,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[Iterator[bytes]] = kwargs.pop("cls", None) @@ -421,14 +420,13 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule + :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either BandwidthSchedule or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -458,8 +456,7 @@ def begin_create_or_update( :paramtype content_type: str :return: An instance of LROPoller that returns either BandwidthSchedule or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -482,17 +479,16 @@ def begin_create_or_update( :type resource_group_name: str :param parameters: The bandwidth schedule to be added or updated. Is either a BandwidthSchedule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule or IO[bytes] + :type parameters: ~azure.mgmt.databoxedge.models.BandwidthSchedule or IO[bytes] :return: An instance of LROPoller that returns either BandwidthSchedule or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.BandwidthSchedule] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.BandwidthSchedule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -549,7 +545,7 @@ def _delete_initial(self, device_name: str, name: str, resource_group_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -603,7 +599,7 @@ def begin_delete(self, device_name: str, name: str, resource_group_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_containers_operations.py similarity index 94% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_containers_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_containers_operations.py index dffe2aa6805f..0cdb5629e7a3 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_containers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_containers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_by_storage_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), @@ -86,14 +85,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), @@ -124,7 +123,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +131,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), @@ -165,14 +164,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), @@ -203,14 +202,14 @@ def build_refresh_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), @@ -236,24 +235,25 @@ class ContainersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`containers` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_storage_account( self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Container"]: + ) -> ItemPaged["_models.Container"]: """Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. @@ -265,13 +265,13 @@ def list_by_storage_account( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Container or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Container] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -305,7 +305,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -354,7 +354,7 @@ def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Container or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Container + :rtype: ~azure.mgmt.databoxedge.models.Container :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -368,7 +368,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Container] = kwargs.pop("cls", None) _request = build_get_request( @@ -421,7 +421,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[Iterator[bytes]] = kwargs.pop("cls", None) @@ -496,12 +496,12 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param container: The container properties. Required. - :type container: ~azure.mgmt.databoxedge.v2019_08_01.models.Container + :type container: ~azure.mgmt.databoxedge.models.Container :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Container or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Container] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -535,7 +535,7 @@ def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Container or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Container] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -563,15 +563,15 @@ def begin_create_or_update( :type resource_group_name: str :param container: The container properties. Is either a Container type or a IO[bytes] type. Required. - :type container: ~azure.mgmt.databoxedge.v2019_08_01.models.Container or IO[bytes] + :type container: ~azure.mgmt.databoxedge.models.Container or IO[bytes] :return: An instance of LROPoller that returns either Container or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Container] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Container] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.Container] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -631,7 +631,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -690,7 +690,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) @@ -743,7 +743,7 @@ def _refresh_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_refresh_request( @@ -804,7 +804,7 @@ def begin_refresh( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_devices_operations.py similarity index 91% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_devices_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_devices_operations.py index c565766426e4..909f7e9388f1 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_devices_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +85,7 @@ def build_list_by_resource_group_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -117,7 +115,7 @@ def build_get_request(device_name: str, resource_group_name: str, subscription_i _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -149,7 +147,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -182,7 +180,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -214,7 +212,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -247,7 +245,7 @@ def build_download_updates_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -278,7 +276,7 @@ def build_generate_certificate_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/generateCertificate", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -309,7 +307,7 @@ def build_get_extended_information_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -340,7 +338,7 @@ def build_install_updates_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -371,7 +369,7 @@ def build_get_network_settings_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -402,7 +400,7 @@ def build_scan_for_updates_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -434,7 +432,7 @@ def build_create_or_update_security_settings_request( # pylint: disable=name-to _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -468,7 +466,7 @@ def build_update_extended_information_request( # pylint: disable=name-too-long _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateExtendedInformation", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -501,7 +499,7 @@ def build_get_update_summary_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -533,7 +531,7 @@ def build_upload_certificate_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -559,24 +557,25 @@ class DevicesOperations: # pylint: disable=too-many-public-methods **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`devices` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription( self, expand: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.DataBoxEdgeDevice"]: + ) -> ItemPaged["_models.DataBoxEdgeDevice"]: """Gets all the Data Box Edge/Data Box Gateway devices in a subscription. :param expand: Specify $expand=details to populate additional fields related to the resource or @@ -584,16 +583,13 @@ def list_by_subscription( None. :type expand: str :return: An iterator like instance of either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeDeviceList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -625,7 +621,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -660,7 +656,7 @@ def get_next(next_link=None): @distributed_trace def list_by_resource_group( self, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.DataBoxEdgeDevice"]: + ) -> ItemPaged["_models.DataBoxEdgeDevice"]: """Gets all the Data Box Edge/Data Box Gateway devices in a resource group. :param resource_group_name: The resource group name. Required. @@ -670,16 +666,13 @@ def list_by_resource_group( None. :type expand: str :return: An iterator like instance of either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeDeviceList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -712,7 +705,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -753,7 +746,7 @@ def get(self, device_name: str, resource_group_name: str, **kwargs: Any) -> _mod :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -767,9 +760,7 @@ def get(self, device_name: str, resource_group_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeDevice] = kwargs.pop("cls", None) _request = build_get_request( @@ -818,9 +809,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -885,15 +874,13 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param data_box_edge_device: The resource object. Required. - :type data_box_edge_device: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -920,8 +907,7 @@ def begin_create_or_update( :paramtype content_type: str :return: An instance of LROPoller that returns either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -941,20 +927,16 @@ def begin_create_or_update( :type resource_group_name: str :param data_box_edge_device: The resource object. Is either a DataBoxEdgeDevice type or a IO[bytes] type. Required. - :type data_box_edge_device: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice or IO[bytes] + :type data_box_edge_device: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice or IO[bytes] :return: An instance of LROPoller that returns either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.DataBoxEdgeDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.DataBoxEdgeDevice] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1010,9 +992,7 @@ def _delete_initial(self, device_name: str, resource_group_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_request( @@ -1063,9 +1043,7 @@ def begin_delete(self, device_name: str, resource_group_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -1119,12 +1097,12 @@ def update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param parameters: The resource parameters. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevicePatch + :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1150,7 +1128,7 @@ def update( Default value is "application/json". :paramtype content_type: str :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1170,10 +1148,9 @@ def update( :type resource_group_name: str :param parameters: The resource parameters. Is either a DataBoxEdgeDevicePatch type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevicePatch or - IO[bytes] + :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevicePatch or IO[bytes] :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDevice + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDevice :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1187,9 +1164,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.DataBoxEdgeDevice] = kwargs.pop("cls", None) @@ -1244,9 +1219,7 @@ def _download_updates_initial(self, device_name: str, resource_group_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_download_updates_request( @@ -1299,9 +1272,7 @@ def begin_download_updates(self, device_name: str, resource_group_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -1349,7 +1320,7 @@ def generate_certificate( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: GenerateCertResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.GenerateCertResponse + :rtype: ~azure.mgmt.databoxedge.models.GenerateCertResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1363,9 +1334,7 @@ def generate_certificate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GenerateCertResponse] = kwargs.pop("cls", None) _request = build_generate_certificate_request( @@ -1407,7 +1376,7 @@ def get_extended_information( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1421,9 +1390,7 @@ def get_extended_information( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataBoxEdgeDeviceExtendedInfo] = kwargs.pop("cls", None) _request = build_get_extended_information_request( @@ -1466,9 +1433,7 @@ def _install_updates_initial(self, device_name: str, resource_group_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_install_updates_request( @@ -1521,9 +1486,7 @@ def begin_install_updates(self, device_name: str, resource_group_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -1571,7 +1534,7 @@ def get_network_settings( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: NetworkSettings or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.NetworkSettings + :rtype: ~azure.mgmt.databoxedge.models.NetworkSettings :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1585,9 +1548,7 @@ def get_network_settings( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetworkSettings] = kwargs.pop("cls", None) _request = build_get_network_settings_request( @@ -1630,9 +1591,7 @@ def _scan_for_updates_initial(self, device_name: str, resource_group_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_scan_for_updates_request( @@ -1685,9 +1644,7 @@ def begin_scan_for_updates(self, device_name: str, resource_group_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -1742,9 +1699,7 @@ def _create_or_update_security_settings_initial( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1809,7 +1764,7 @@ def begin_create_or_update_security_settings( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param security_settings: The security settings. Required. - :type security_settings: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SecuritySettings + :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1860,8 +1815,7 @@ def begin_create_or_update_security_settings( :type resource_group_name: str :param security_settings: The security settings. Is either a SecuritySettings type or a IO[bytes] type. Required. - :type security_settings: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.SecuritySettings or - IO[bytes] + :type security_settings: ~azure.mgmt.databoxedge.models.SecuritySettings 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: @@ -1869,9 +1823,7 @@ def begin_create_or_update_security_settings( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -1928,13 +1880,12 @@ def update_extended_information( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param parameters: The patch object. Required. - :type parameters: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfoPatch + :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1960,7 +1911,7 @@ def update_extended_information( Default value is "application/json". :paramtype content_type: str :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1980,11 +1931,10 @@ def update_extended_information( :type resource_group_name: str :param parameters: The patch object. Is either a DataBoxEdgeDeviceExtendedInfoPatch type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfoPatch or + :type parameters: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfoPatch or IO[bytes] :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DataBoxEdgeDeviceExtendedInfo + :rtype: ~azure.mgmt.databoxedge.models.DataBoxEdgeDeviceExtendedInfo :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1998,9 +1948,7 @@ def update_extended_information( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.DataBoxEdgeDeviceExtendedInfo] = kwargs.pop("cls", None) @@ -2056,7 +2004,7 @@ def get_update_summary(self, device_name: str, resource_group_name: str, **kwarg :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: UpdateSummary or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UpdateSummary + :rtype: ~azure.mgmt.databoxedge.models.UpdateSummary :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2070,9 +2018,7 @@ def get_update_summary(self, device_name: str, resource_group_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UpdateSummary] = kwargs.pop("cls", None) _request = build_get_update_summary_request( @@ -2120,12 +2066,12 @@ def upload_certificate( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param parameters: The upload certificate request. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateRequest + :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2151,7 +2097,7 @@ def upload_certificate( Default value is "application/json". :paramtype content_type: str :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2171,10 +2117,9 @@ def upload_certificate( :type resource_group_name: str :param parameters: The upload certificate request. Is either a UploadCertificateRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateRequest - or IO[bytes] + :type parameters: ~azure.mgmt.databoxedge.models.UploadCertificateRequest or IO[bytes] :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.UploadCertificateResponse + :rtype: ~azure.mgmt.databoxedge.models.UploadCertificateResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2188,9 +2133,7 @@ def upload_certificate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.UploadCertificateResponse] = kwargs.pop("cls", None) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_jobs_operations.py similarity index 84% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_jobs_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_jobs_operations.py index 7b1867468c67..43113d431969 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_jobs_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,10 @@ # 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 collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,14 +41,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -74,19 +73,20 @@ class JobsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`jobs` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Job: @@ -101,7 +101,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Job + :rtype: ~azure.mgmt.databoxedge.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -115,7 +115,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_monitoring_config_operations.py similarity index 90% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_monitoring_config_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_monitoring_config_operations.py index ee8e17b44f7b..661c1288376d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_monitoring_config_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_monitoring_config_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -56,7 +55,7 @@ def build_list_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "roleName": _SERIALIZER.url("role_name", role_name, "str"), @@ -88,7 +87,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "roleName": _SERIALIZER.url("role_name", role_name, "str"), @@ -121,7 +120,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "roleName": _SERIALIZER.url("role_name", role_name, "str"), @@ -155,7 +154,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{roleName}/monitoringConfig/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "roleName": _SERIALIZER.url("role_name", role_name, "str"), @@ -180,24 +179,25 @@ class MonitoringConfigOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`monitoring_config` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( self, device_name: str, role_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.MonitoringMetricConfiguration"]: + ) -> ItemPaged["_models.MonitoringMetricConfiguration"]: """Lists metric configurations in a role. Lists metric configurations in a role. @@ -211,15 +211,13 @@ def list( :return: An iterator like instance of either MonitoringMetricConfiguration or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitoringMetricConfigurationList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -253,7 +251,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -300,7 +298,7 @@ def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: MonitoringMetricConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration + :rtype: ~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -314,9 +312,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MonitoringMetricConfiguration] = kwargs.pop("cls", None) _request = build_get_request( @@ -367,9 +363,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -441,14 +435,14 @@ def begin_create_or_update( :type resource_group_name: str :param monitoring_metric_configuration: The metric configuration. Required. :type monitoring_metric_configuration: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration + ~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -481,7 +475,7 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -507,19 +501,17 @@ def begin_create_or_update( :param monitoring_metric_configuration: The metric configuration. Is either a MonitoringMetricConfiguration type or a IO[bytes] type. Required. :type monitoring_metric_configuration: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration or IO[bytes] + ~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration or IO[bytes] :return: An instance of LROPoller that returns either MonitoringMetricConfiguration or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.MonitoringMetricConfiguration] + ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.MonitoringMetricConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.MonitoringMetricConfiguration] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -578,9 +570,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_request( @@ -638,9 +628,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_nodes_operations.py similarity index 84% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_nodes_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_nodes_operations.py index 683fb55e0e6b..2bdbab0fb923 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_nodes_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,10 +6,11 @@ # 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 +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +50,7 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -75,24 +74,25 @@ class NodesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`nodes` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Node"]: + ) -> ItemPaged["_models.Node"]: """Gets all the nodes currently configured under this Data Box Edge device. :param device_name: The device name. Required. @@ -100,15 +100,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Node or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Node] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.Node] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NodeList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -141,7 +139,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations.py similarity index 82% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations.py index 1a5cd654752f..e1e7ebe669d4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations.py @@ -5,10 +5,11 @@ # 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 +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,34 +61,35 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`operations` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: """List all the supported operations. List all the supported operations. :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Operation] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationsList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -120,7 +119,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations_status_operations.py similarity index 84% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations_status_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations_status_operations.py index cdf827f69296..69a04ed4a592 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations_status_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,10 @@ # 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 collections.abc import MutableMapping from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -23,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,14 +41,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -74,19 +73,20 @@ class OperationsStatusOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`operations_status` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Job: @@ -101,7 +101,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Job + :rtype: ~azure.mgmt.databoxedge.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -115,7 +115,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_orders_operations.py similarity index 91% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_orders_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_orders_operations.py index 445cfe50baad..c61e878edb9b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_orders_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -56,7 +55,7 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -85,7 +84,7 @@ def build_get_request(device_name: str, resource_group_name: str, subscription_i _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -117,7 +116,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -150,7 +149,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -181,7 +180,7 @@ def build_list_dc_access_code_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default/listDCAccessCode", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -205,24 +204,25 @@ class OrdersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`orders` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Order"]: + ) -> ItemPaged["_models.Order"]: """Lists all the orders related to a Data Box Edge/Data Box Gateway device. Lists all the orders related to a Data Box Edge/Data Box Gateway device. @@ -232,15 +232,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Order or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OrderList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -273,7 +271,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -316,7 +314,7 @@ def get(self, device_name: str, resource_group_name: str, **kwargs: Any) -> _mod :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Order or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order + :rtype: ~azure.mgmt.databoxedge.models.Order :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -330,9 +328,7 @@ def get(self, device_name: str, resource_group_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Order] = kwargs.pop("cls", None) _request = build_get_request( @@ -377,9 +373,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -446,12 +440,12 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param order: The order to be created or updated. Required. - :type order: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order + :type order: ~azure.mgmt.databoxedge.models.Order :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Order or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -479,7 +473,7 @@ def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Order or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -497,17 +491,15 @@ def begin_create_or_update( :type resource_group_name: str :param order: The order to be created or updated. Is either a Order type or a IO[bytes] type. Required. - :type order: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order or IO[bytes] + :type order: ~azure.mgmt.databoxedge.models.Order or IO[bytes] :return: An instance of LROPoller that returns either Order or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Order] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Order] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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.Order] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -563,9 +555,7 @@ def _delete_initial(self, device_name: str, resource_group_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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_request( @@ -618,9 +608,7 @@ def begin_delete(self, device_name: str, resource_group_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + 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) @@ -668,7 +656,7 @@ def list_dc_access_code(self, device_name: str, resource_group_name: str, **kwar :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: DCAccessCode or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.DCAccessCode + :rtype: ~azure.mgmt.databoxedge.models.DCAccessCode :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -682,9 +670,7 @@ def list_dc_access_code(self, device_name: str, resource_group_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DCAccessCode] = kwargs.pop("cls", None) _request = build_list_dc_access_code_request( diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_patch.py new file mode 100644 index 000000000000..8bcb627aa475 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_roles_operations.py similarity index 93% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_roles_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_roles_operations.py index 4df33600672b..11a782158780 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_roles_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -80,14 +79,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -112,7 +111,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +119,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -147,14 +146,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -179,24 +178,25 @@ class RolesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`roles` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Role"]: + ) -> ItemPaged["_models.Role"]: """Lists all the roles configured in a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. @@ -204,13 +204,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Role or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Role] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RoleList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -243,7 +243,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -286,7 +286,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Role or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Role + :rtype: ~azure.mgmt.databoxedge.models.Role :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -300,7 +300,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Role] = kwargs.pop("cls", None) _request = build_get_request( @@ -346,7 +346,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[Iterator[bytes]] = kwargs.pop("cls", None) @@ -415,12 +415,12 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param role: The role properties. Required. - :type role: ~azure.mgmt.databoxedge.v2019_08_01.models.Role + :type role: ~azure.mgmt.databoxedge.models.Role :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Role or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Role] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -449,7 +449,7 @@ def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Role or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Role] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -466,15 +466,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param role: The role properties. Is either a Role type or a IO[bytes] type. Required. - :type role: ~azure.mgmt.databoxedge.v2019_08_01.models.Role or IO[bytes] + :type role: ~azure.mgmt.databoxedge.models.Role or IO[bytes] :return: An instance of LROPoller that returns either Role or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Role] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Role] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.Role] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -531,7 +531,7 @@ def _delete_initial(self, device_name: str, name: str, resource_group_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -585,7 +585,7 @@ def begin_delete(self, device_name: str, name: str, resource_group_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_shares_operations.py similarity index 93% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_shares_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_shares_operations.py index d7de768b2bb8..faa7f6562590 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_shares_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -80,14 +79,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -112,7 +111,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +119,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -147,14 +146,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -179,14 +178,14 @@ def build_refresh_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -211,24 +210,25 @@ class SharesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`shares` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Share"]: + ) -> ItemPaged["_models.Share"]: """Lists all the shares in a Data Box Edge/Data Box Gateway device. Lists all the shares in a Data Box Edge/Data Box Gateway device. @@ -238,13 +238,13 @@ def list_by_data_box_edge_device( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Share or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Share] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ShareList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -277,7 +277,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -322,7 +322,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Share or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Share + :rtype: ~azure.mgmt.databoxedge.models.Share :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -336,7 +336,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Share] = kwargs.pop("cls", None) _request = build_get_request( @@ -387,7 +387,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[Iterator[bytes]] = kwargs.pop("cls", None) @@ -458,12 +458,12 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param share: The share properties. Required. - :type share: ~azure.mgmt.databoxedge.v2019_08_01.models.Share + :type share: ~azure.mgmt.databoxedge.models.Share :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Share or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Share] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -494,7 +494,7 @@ def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Share or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Share] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -518,15 +518,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param share: The share properties. Is either a Share type or a IO[bytes] type. Required. - :type share: ~azure.mgmt.databoxedge.v2019_08_01.models.Share or IO[bytes] + :type share: ~azure.mgmt.databoxedge.models.Share or IO[bytes] :return: An instance of LROPoller that returns either Share or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Share] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Share] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.Share] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -583,7 +583,7 @@ def _delete_initial(self, device_name: str, name: str, resource_group_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -637,7 +637,7 @@ def begin_delete(self, device_name: str, name: str, resource_group_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) @@ -687,7 +687,7 @@ def _refresh_initial(self, device_name: str, name: str, resource_group_name: str _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_refresh_request( @@ -743,7 +743,7 @@ def begin_refresh(self, device_name: str, name: str, resource_group_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_account_credentials_operations.py similarity index 91% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_account_credentials_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_account_credentials_operations.py index 343ae21aa76f..15d11b43e075 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_account_credentials_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -80,14 +79,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -112,7 +111,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +119,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -147,14 +146,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -179,24 +178,25 @@ class StorageAccountCredentialsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`storage_account_credentials` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.StorageAccountCredential"]: + ) -> ItemPaged["_models.StorageAccountCredential"]: """Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. @@ -207,14 +207,13 @@ def list_by_data_box_edge_device( :type resource_group_name: str :return: An iterator like instance of either StorageAccountCredential or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountCredentialList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -247,7 +246,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -292,7 +291,7 @@ def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: StorageAccountCredential or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential + :rtype: ~azure.mgmt.databoxedge.models.StorageAccountCredential :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -306,7 +305,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountCredential] = kwargs.pop("cls", None) _request = build_get_request( @@ -357,7 +356,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[Iterator[bytes]] = kwargs.pop("cls", None) @@ -426,15 +425,13 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param storage_account_credential: The storage account credential. Required. - :type storage_account_credential: - ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential + :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either StorageAccountCredential or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -464,8 +461,7 @@ def begin_create_or_update( :paramtype content_type: str :return: An instance of LROPoller that returns either StorageAccountCredential or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -488,18 +484,17 @@ def begin_create_or_update( :type resource_group_name: str :param storage_account_credential: The storage account credential. Is either a StorageAccountCredential type or a IO[bytes] type. Required. - :type storage_account_credential: - ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential or IO[bytes] + :type storage_account_credential: ~azure.mgmt.databoxedge.models.StorageAccountCredential or + IO[bytes] :return: An instance of LROPoller that returns either StorageAccountCredential or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.StorageAccountCredential] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.StorageAccountCredential] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -556,7 +551,7 @@ def _delete_initial(self, device_name: str, name: str, resource_group_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -610,7 +605,7 @@ def begin_delete(self, device_name: str, name: str, resource_group_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_accounts_operations.py similarity index 91% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_accounts_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_accounts_operations.py index d6b83b680d3e..b5d95f85d48d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_storage_accounts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_accounts_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -80,14 +79,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), @@ -112,7 +111,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +119,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), @@ -147,14 +146,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), @@ -179,40 +178,41 @@ class StorageAccountsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`storage_accounts` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.StorageAccount"]: - """Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + ) -> ItemPaged["_models.StorageAccount"]: + """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. - Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. :type device_name: str :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either StorageAccount or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccountList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -245,7 +245,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -292,7 +292,7 @@ def get( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: StorageAccount or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount + :rtype: ~azure.mgmt.databoxedge.models.StorageAccount :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -306,7 +306,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None) _request = build_get_request( @@ -357,7 +357,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[Iterator[bytes]] = kwargs.pop("cls", None) @@ -428,14 +428,13 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param storage_account: The StorageAccount properties. Required. - :type storage_account: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount + :type storage_account: ~azure.mgmt.databoxedge.models.StorageAccount :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -467,8 +466,7 @@ def begin_create_or_update( :paramtype content_type: str :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -493,17 +491,16 @@ def begin_create_or_update( :type resource_group_name: str :param storage_account: The StorageAccount properties. Is either a StorageAccount type or a IO[bytes] type. Required. - :type storage_account: ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount or IO[bytes] + :type storage_account: ~azure.mgmt.databoxedge.models.StorageAccount or IO[bytes] :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.StorageAccount] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -562,7 +559,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -618,7 +615,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_triggers_operations.py similarity index 93% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_triggers_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_triggers_operations.py index ab4ef8559e66..841d65f37a52 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_triggers_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -82,14 +81,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -114,7 +113,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -122,7 +121,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -149,14 +148,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -181,24 +180,25 @@ class TriggersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`triggers` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( self, device_name: str, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Trigger"]: + ) -> ItemPaged["_models.Trigger"]: """Lists all the triggers configured in the device. :param device_name: The device name. Required. @@ -209,13 +209,13 @@ def list_by_data_box_edge_device( tag property. Default value is None. :type filter: str :return: An iterator like instance of either Trigger or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TriggerList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -249,7 +249,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -292,7 +292,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: Trigger or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Trigger + :rtype: ~azure.mgmt.databoxedge.models.Trigger :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -306,7 +306,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Trigger] = kwargs.pop("cls", None) _request = build_get_request( @@ -357,7 +357,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[Iterator[bytes]] = kwargs.pop("cls", None) @@ -426,12 +426,12 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param trigger: The trigger. Required. - :type trigger: ~azure.mgmt.databoxedge.v2019_08_01.models.Trigger + :type trigger: ~azure.mgmt.databoxedge.models.Trigger :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Trigger or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -460,7 +460,7 @@ def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either Trigger or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -482,15 +482,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param trigger: The trigger. Is either a Trigger type or a IO[bytes] type. Required. - :type trigger: ~azure.mgmt.databoxedge.v2019_08_01.models.Trigger or IO[bytes] + :type trigger: ~azure.mgmt.databoxedge.models.Trigger or IO[bytes] :return: An instance of LROPoller that returns either Trigger or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.Trigger] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.Trigger] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -547,7 +547,7 @@ def _delete_initial(self, device_name: str, name: str, resource_group_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -601,7 +601,7 @@ def begin_delete(self, device_name: str, name: str, resource_group_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_users_operations.py similarity index 91% rename from sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_users_operations.py rename to sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_users_operations.py index cae7ffdc66ac..08f20fd5f180 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_users_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Serializer +from .._configuration import DataBoxEdgeManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,19 +43,19 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long - device_name: str, resource_group_name: str, subscription_id: str, *, filter: Optional[str] = None, **kwargs: Any + device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -67,8 +66,8 @@ def build_list_by_data_box_edge_device_request( # pylint: disable=name-too-long # 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") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -82,14 +81,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -114,7 +113,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -122,7 +121,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -149,14 +148,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "deviceName": _SERIALIZER.url("device_name", device_name, "str"), "name": _SERIALIZER.url("name", name, "str"), @@ -181,41 +180,43 @@ class UsersOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s + :class:`~azure.mgmt.databoxedge.DataBoxEdgeManagementClient`'s :attr:`users` attribute. """ models = _models - def __init__(self, *args, **kwargs): + 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DataBoxEdgeManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.User"]: + self, device_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.User"]: """Gets all the users registered on a Data Box Edge/Data Box Gateway device. :param device_name: The device name. Required. :type device_name: str :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param filter: Specify $filter='UserType eq :code:``' to filter on user type property. - Default value is None. - :type filter: str + :param expand: Specify $expand=details to populate additional fields related to the resource or + Specify $skipToken=\\ :code:`` to populate the next page in the list. Default value is + None. + :type expand: str :return: An iterator like instance of either User or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.User] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UserList] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -233,7 +234,7 @@ def prepare_request(next_link=None): device_name=device_name, resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, - filter=filter, + expand=expand, api_version=api_version, headers=_headers, params=_params, @@ -249,7 +250,7 @@ def prepare_request(next_link=None): for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) - _next_request_params["api-version"] = self._api_version + _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 ) @@ -292,7 +293,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: User or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.User + :rtype: ~azure.mgmt.databoxedge.models.User :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -306,7 +307,7 @@ def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.User] = kwargs.pop("cls", None) _request = build_get_request( @@ -352,7 +353,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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[Iterator[bytes]] = kwargs.pop("cls", None) @@ -422,12 +423,12 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param user: The user details. Required. - :type user: ~azure.mgmt.databoxedge.v2019_08_01.models.User + :type user: ~azure.mgmt.databoxedge.models.User :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either User or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.User] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -457,7 +458,7 @@ def begin_create_or_update( Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns either User or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.User] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -475,15 +476,15 @@ def begin_create_or_update( :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param user: The user details. Is either a User type or a IO[bytes] type. Required. - :type user: ~azure.mgmt.databoxedge.v2019_08_01.models.User or IO[bytes] + :type user: ~azure.mgmt.databoxedge.models.User or IO[bytes] :return: An instance of LROPoller that returns either User or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.User] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.models.User] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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.User] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -540,7 +541,7 @@ def _delete_initial(self, device_name: str, name: str, resource_group_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) + 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_request( @@ -594,7 +595,7 @@ def begin_delete(self, device_name: str, name: str, resource_group_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-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) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/__init__.py deleted file mode 100644 index 0bedbc7bb26e..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/__init__.py +++ /dev/null @@ -1,32 +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. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._data_box_edge_management_client import DataBoxEdgeManagementClient # type: ignore -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxEdgeManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_configuration.py deleted file mode 100644 index 166748ce8220..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_configuration.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class DataBoxEdgeManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxEdgeManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription ID. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2019-08-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: - api_version: str = kwargs.pop("api_version", "2019-08-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-databoxedge/{}".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.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 - ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_data_box_edge_management_client.py deleted file mode 100644 index b194a0f1dec0..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_data_box_edge_management_client.py +++ /dev/null @@ -1,187 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient -from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxEdgeManagementClientConfiguration -from .operations import ( - AlertsOperations, - BandwidthSchedulesOperations, - ContainersOperations, - DevicesOperations, - JobsOperations, - NodesOperations, - Operations, - OperationsStatusOperations, - OrdersOperations, - RolesOperations, - SharesOperations, - SkusOperations, - StorageAccountCredentialsOperations, - StorageAccountsOperations, - TriggersOperations, - UsersOperations, -) - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class DataBoxEdgeManagementClient: # pylint: disable=too-many-instance-attributes - """The DataBoxEdge Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.v2019_08_01.operations.Operations - :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.v2019_08_01.operations.DevicesOperations - :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.v2019_08_01.operations.AlertsOperations - :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: - azure.mgmt.databoxedge.v2019_08_01.operations.BandwidthSchedulesOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.v2019_08_01.operations.JobsOperations - :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.v2019_08_01.operations.NodesOperations - :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: - azure.mgmt.databoxedge.v2019_08_01.operations.OperationsStatusOperations - :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.v2019_08_01.operations.OrdersOperations - :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.v2019_08_01.operations.RolesOperations - :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.v2019_08_01.operations.SharesOperations - :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: - azure.mgmt.databoxedge.v2019_08_01.operations.StorageAccountCredentialsOperations - :ivar storage_accounts: StorageAccountsOperations operations - :vartype storage_accounts: - azure.mgmt.databoxedge.v2019_08_01.operations.StorageAccountsOperations - :ivar containers: ContainersOperations operations - :vartype containers: azure.mgmt.databoxedge.v2019_08_01.operations.ContainersOperations - :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.v2019_08_01.operations.TriggersOperations - :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.v2019_08_01.operations.UsersOperations - :ivar skus: SkusOperations operations - :vartype skus: azure.mgmt.databoxedge.v2019_08_01.operations.SkusOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription ID. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2019-08-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 = DataBoxEdgeManagementClientConfiguration( - 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 - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.devices = DevicesOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.bandwidth_schedules = BandwidthSchedulesOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.nodes = NodesOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.operations_status = OperationsStatusOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.roles = RolesOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.shares = SharesOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.storage_account_credentials = StorageAccountCredentialsOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.storage_accounts = StorageAccountsOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.containers = ContainersOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.users = UsersOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> Self: - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_metadata.json deleted file mode 100644 index 11ab0682ab01..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/_metadata.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "chosen_version": "2019-08-01", - "total_api_version_list": ["2019-08-01"], - "client": { - "name": "DataBoxEdgeManagementClient", - "filename": "_data_box_edge_management_client", - "description": "The DataBoxEdge Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_public_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The subscription ID. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The subscription ID. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "devices": "DevicesOperations", - "alerts": "AlertsOperations", - "bandwidth_schedules": "BandwidthSchedulesOperations", - "jobs": "JobsOperations", - "nodes": "NodesOperations", - "operations_status": "OperationsStatusOperations", - "orders": "OrdersOperations", - "roles": "RolesOperations", - "shares": "SharesOperations", - "storage_account_credentials": "StorageAccountCredentialsOperations", - "storage_accounts": "StorageAccountsOperations", - "containers": "ContainersOperations", - "triggers": "TriggersOperations", - "users": "UsersOperations", - "skus": "SkusOperations" - } -} diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/__init__.py deleted file mode 100644 index c86847aa9e87..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/__init__.py +++ /dev/null @@ -1,29 +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. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._data_box_edge_management_client import DataBoxEdgeManagementClient # type: ignore - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxEdgeManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_configuration.py deleted file mode 100644 index 98496874f6a3..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_configuration.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxEdgeManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxEdgeManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription ID. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2019-08-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: - api_version: str = kwargs.pop("api_version", "2019-08-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-databoxedge/{}".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.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 - ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_data_box_edge_management_client.py deleted file mode 100644 index f8d169640683..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/_data_box_edge_management_client.py +++ /dev/null @@ -1,189 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient -from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxEdgeManagementClientConfiguration -from .operations import ( - AlertsOperations, - BandwidthSchedulesOperations, - ContainersOperations, - DevicesOperations, - JobsOperations, - NodesOperations, - Operations, - OperationsStatusOperations, - OrdersOperations, - RolesOperations, - SharesOperations, - SkusOperations, - StorageAccountCredentialsOperations, - StorageAccountsOperations, - TriggersOperations, - UsersOperations, -) - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxEdgeManagementClient: # pylint: disable=too-many-instance-attributes - """The DataBoxEdge Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.v2019_08_01.aio.operations.Operations - :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.v2019_08_01.aio.operations.DevicesOperations - :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.v2019_08_01.aio.operations.AlertsOperations - :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: - azure.mgmt.databoxedge.v2019_08_01.aio.operations.BandwidthSchedulesOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.v2019_08_01.aio.operations.JobsOperations - :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.v2019_08_01.aio.operations.NodesOperations - :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: - azure.mgmt.databoxedge.v2019_08_01.aio.operations.OperationsStatusOperations - :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.v2019_08_01.aio.operations.OrdersOperations - :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.v2019_08_01.aio.operations.RolesOperations - :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.v2019_08_01.aio.operations.SharesOperations - :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: - azure.mgmt.databoxedge.v2019_08_01.aio.operations.StorageAccountCredentialsOperations - :ivar storage_accounts: StorageAccountsOperations operations - :vartype storage_accounts: - azure.mgmt.databoxedge.v2019_08_01.aio.operations.StorageAccountsOperations - :ivar containers: ContainersOperations operations - :vartype containers: azure.mgmt.databoxedge.v2019_08_01.aio.operations.ContainersOperations - :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.v2019_08_01.aio.operations.TriggersOperations - :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.v2019_08_01.aio.operations.UsersOperations - :ivar skus: SkusOperations operations - :vartype skus: azure.mgmt.databoxedge.v2019_08_01.aio.operations.SkusOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription ID. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2019-08-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 = DataBoxEdgeManagementClientConfiguration( - 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 - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.devices = DevicesOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.alerts = AlertsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.bandwidth_schedules = BandwidthSchedulesOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.nodes = NodesOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.operations_status = OperationsStatusOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.orders = OrdersOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.roles = RolesOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.shares = SharesOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.storage_account_credentials = StorageAccountCredentialsOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.storage_accounts = StorageAccountsOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.containers = ContainersOperations( - self._client, self._config, self._serialize, self._deserialize, "2019-08-01" - ) - self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.users = UsersOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") - - def _send_request( - self, request: HttpRequest, *, stream: bool = False, **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> Self: - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/__init__.py deleted file mode 100644 index d7e775aadef6..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/__init__.py +++ /dev/null @@ -1,55 +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. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import Operations # type: ignore -from ._devices_operations import DevicesOperations # type: ignore -from ._alerts_operations import AlertsOperations # type: ignore -from ._bandwidth_schedules_operations import BandwidthSchedulesOperations # type: ignore -from ._jobs_operations import JobsOperations # type: ignore -from ._nodes_operations import NodesOperations # type: ignore -from ._operations_status_operations import OperationsStatusOperations # type: ignore -from ._orders_operations import OrdersOperations # type: ignore -from ._roles_operations import RolesOperations # type: ignore -from ._shares_operations import SharesOperations # type: ignore -from ._storage_account_credentials_operations import StorageAccountCredentialsOperations # type: ignore -from ._storage_accounts_operations import StorageAccountsOperations # type: ignore -from ._containers_operations import ContainersOperations # type: ignore -from ._triggers_operations import TriggersOperations # type: ignore -from ._users_operations import UsersOperations # type: ignore -from ._skus_operations import SkusOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "DevicesOperations", - "AlertsOperations", - "BandwidthSchedulesOperations", - "JobsOperations", - "NodesOperations", - "OperationsStatusOperations", - "OrdersOperations", - "RolesOperations", - "SharesOperations", - "StorageAccountCredentialsOperations", - "StorageAccountsOperations", - "ContainersOperations", - "TriggersOperations", - "UsersOperations", - "SkusOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_devices_operations.py deleted file mode 100644 index 8829e5af2a49..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_devices_operations.py +++ /dev/null @@ -1,1521 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._devices_operations import ( - build_create_or_update_request, - build_create_or_update_security_settings_request, - build_delete_request, - build_download_updates_request, - build_get_extended_information_request, - build_get_network_settings_request, - build_get_request, - build_get_update_summary_request, - build_install_updates_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_scan_for_updates_request, - build_update_request, - build_upload_certificate_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DevicesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s - :attr:`devices` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_subscription( - self, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.DataBoxEdgeDevice"]: - """Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - - :param expand: Specify $expand=details to populate additional fields related to the resource or - Specify $skipToken=\\ :code:`` to populate the next page in the list. Default value is - None. - :type expand: str - :return: An iterator like instance of either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.DataBoxEdgeDeviceList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataBoxEdgeDeviceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.DataBoxEdgeDevice"]: - """Gets all the Data Box Edge/Data Box Gateway devices in a resource group. - - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param expand: Specify $expand=details to populate additional fields related to the resource or - Specify $skipToken=\\ :code:`` to populate the next page in the list. Default value is - None. - :type expand: str - :return: An iterator like instance of either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.DataBoxEdgeDeviceList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataBoxEdgeDeviceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, device_name: str, resource_group_name: str, **kwargs: Any) -> _models.DataBoxEdgeDevice: - """Gets the properties of the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.DataBoxEdgeDevice] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataBoxEdgeDevice", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - device_name: str, - resource_group_name: str, - data_box_edge_device: Union[_models.DataBoxEdgeDevice, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(data_box_edge_device, (IOBase, bytes)): - _content = data_box_edge_device - else: - _json = self._serialize.body(data_box_edge_device, "DataBoxEdgeDevice") - - _request = build_create_or_update_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - data_box_edge_device: _models.DataBoxEdgeDevice, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataBoxEdgeDevice]: - """Creates or updates a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param data_box_edge_device: The resource object. Required. - :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either DataBoxEdgeDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - data_box_edge_device: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataBoxEdgeDevice]: - """Creates or updates a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param data_box_edge_device: The resource object. Required. - :type data_box_edge_device: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either DataBoxEdgeDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - data_box_edge_device: Union[_models.DataBoxEdgeDevice, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DataBoxEdgeDevice]: - """Creates or updates a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param data_box_edge_device: The resource object. Is either a DataBoxEdgeDevice type or a - IO[bytes] type. Required. - :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either DataBoxEdgeDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataBoxEdgeDevice] = 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_or_update_initial( - device_name=device_name, - resource_group_name=resource_group_name, - data_box_edge_device=data_box_edge_device, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DataBoxEdgeDevice", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DataBoxEdgeDevice].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DataBoxEdgeDevice]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial(self, device_name: str, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, device_name: str, resource_group_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - async def update( - self, - device_name: str, - resource_group_name: str, - parameters: _models.DataBoxEdgeDevicePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataBoxEdgeDevice: - """Modifies a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The resource parameters. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevicePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - device_name: str, - resource_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataBoxEdgeDevice: - """Modifies a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The resource parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - device_name: str, - resource_group_name: str, - parameters: Union[_models.DataBoxEdgeDevicePatch, IO[bytes]], - **kwargs: Any - ) -> _models.DataBoxEdgeDevice: - """Modifies a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The resource parameters. Is either a DataBoxEdgeDevicePatch type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevicePatch or - IO[bytes] - :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataBoxEdgeDevice] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DataBoxEdgeDevicePatch") - - _request = build_update_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataBoxEdgeDevice", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _download_updates_initial( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_download_updates_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_download_updates( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Downloads the updates on a Data Box Edge/Data Box Gateway device. - - Downloads the updates on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._download_updates_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get_extended_information( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.DataBoxEdgeDeviceExtendedInfo: - """Gets additional information for the specified Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceExtendedInfo - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.DataBoxEdgeDeviceExtendedInfo] = kwargs.pop("cls", None) - - _request = build_get_extended_information_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataBoxEdgeDeviceExtendedInfo", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _install_updates_initial( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_install_updates_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_install_updates( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Installs the updates on the Data Box Edge/Data Box Gateway device. - - Installs the updates on the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._install_updates_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get_network_settings( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.NetworkSettings: - """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: NetworkSettings or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkSettings - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.NetworkSettings] = kwargs.pop("cls", None) - - _request = build_get_network_settings_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkSettings", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _scan_for_updates_initial( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_scan_for_updates_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_scan_for_updates( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Scans for updates on a Data Box Edge/Data Box Gateway device. - - Scans for updates on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._scan_for_updates_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _create_or_update_security_settings_initial( # pylint: disable=name-too-long - self, - device_name: str, - resource_group_name: str, - security_settings: Union[_models.SecuritySettings, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(security_settings, (IOBase, bytes)): - _content = security_settings - else: - _json = self._serialize.body(security_settings, "SecuritySettings") - - _request = build_create_or_update_security_settings_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update_security_settings( - self, - device_name: str, - resource_group_name: str, - security_settings: _models.SecuritySettings, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the security settings on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param security_settings: The security settings. Required. - :type security_settings: ~azure.mgmt.databoxedge.v2019_08_01.models.SecuritySettings - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update_security_settings( - self, - device_name: str, - resource_group_name: str, - security_settings: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the security settings on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param security_settings: The security settings. Required. - :type security_settings: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update_security_settings( - self, - device_name: str, - resource_group_name: str, - security_settings: Union[_models.SecuritySettings, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Updates the security settings on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param security_settings: The security settings. Is either a SecuritySettings type or a - IO[bytes] type. Required. - :type security_settings: ~azure.mgmt.databoxedge.v2019_08_01.models.SecuritySettings 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: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_security_settings_initial( - device_name=device_name, - resource_group_name=resource_group_name, - security_settings=security_settings, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get_update_summary( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.UpdateSummary: - """Gets information about the availability of updates based on the last scan of the device. It - also gets information about any ongoing download or install jobs on the device. - - Gets information about the availability of updates based on the last scan of the device. It - also gets information about any ongoing download or install jobs on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: UpdateSummary or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateSummary - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.UpdateSummary] = kwargs.pop("cls", None) - - _request = build_get_update_summary_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateSummary", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def upload_certificate( - self, - device_name: str, - resource_group_name: str, - parameters: _models.UploadCertificateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UploadCertificateResponse: - """Uploads registration certificate for the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The upload certificate request. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def upload_certificate( - self, - device_name: str, - resource_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UploadCertificateResponse: - """Uploads registration certificate for the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The upload certificate request. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def upload_certificate( - self, - device_name: str, - resource_group_name: str, - parameters: Union[_models.UploadCertificateRequest, IO[bytes]], - **kwargs: Any - ) -> _models.UploadCertificateResponse: - """Uploads registration certificate for the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The upload certificate request. Is either a UploadCertificateRequest type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateRequest or - IO[bytes] - :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UploadCertificateResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "UploadCertificateRequest") - - _request = build_upload_certificate_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UploadCertificateResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_nodes_operations.py deleted file mode 100644 index 4f18331e8e3a..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_nodes_operations.py +++ /dev/null @@ -1,139 +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, 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.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._nodes_operations import build_list_by_data_box_edge_device_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NodesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s - :attr:`nodes` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Node"]: - """Gets all the nodes currently configured under this Data Box Edge device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Node or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Node] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.NodeList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NodeList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_orders_operations.py deleted file mode 100644 index 00dce7b0af3e..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_orders_operations.py +++ /dev/null @@ -1,494 +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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._orders_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_data_box_edge_device_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Order"]: - """Lists all the orders related to a Data Box Edge/Data Box Gateway device. - - Lists all the orders related to a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Order or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Order] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.OrderList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OrderList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, device_name: str, resource_group_name: str, **kwargs: Any) -> _models.Order: - """Gets a specific order by name. - - Gets a specific order by name. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Order or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Order - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.Order] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Order", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, device_name: str, resource_group_name: str, order: Union[_models.Order, IO[bytes]], **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order, (IOBase, bytes)): - _content = order - else: - _json = self._serialize.body(order, "Order") - - _request = build_create_or_update_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - order: _models.Order, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Order]: - """Creates or updates an order. - - Creates or updates an order. - - :param device_name: The order details of a device. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param order: The order to be created or updated. Required. - :type order: ~azure.mgmt.databoxedge.v2019_08_01.models.Order - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Order or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Order] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - order: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Order]: - """Creates or updates an order. - - Creates or updates an order. - - :param device_name: The order details of a device. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param order: The order to be created or updated. Required. - :type order: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Order or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Order] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, device_name: str, resource_group_name: str, order: Union[_models.Order, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Order]: - """Creates or updates an order. - - Creates or updates an order. - - :param device_name: The order details of a device. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param order: The order to be created or updated. Is either a Order type or a IO[bytes] type. - Required. - :type order: ~azure.mgmt.databoxedge.v2019_08_01.models.Order or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Order or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Order] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Order] = 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_or_update_initial( - device_name=device_name, - resource_group_name=resource_group_name, - order=order, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Order", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Order].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Order]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial(self, device_name: str, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, device_name: str, resource_group_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes the order related to the device. - - Deletes the order related to the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_skus_operations.py deleted file mode 100644 index 97ff610984f1..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/aio/operations/_skus_operations.py +++ /dev/null @@ -1,137 +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, 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.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._skus_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.aio.DataBoxEdgeManagementClient`'s - :attr:`skus` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.ResourceTypeSku"]: - """List all the available Skus in the region and information related to them. - - List all the available Skus in the region and information related to them. - - :param filter: Specify $filter='location eq :code:``' to filter on location. Default - value is None. - :type filter: str - :return: An iterator like instance of either ResourceTypeSku or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.ResourceTypeSku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.SkuInformationList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuInformationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/__init__.py deleted file mode 100644 index 0fd5c0fc0ae3..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/__init__.py +++ /dev/null @@ -1,262 +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. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models_py3 import ( # type: ignore - ARMBaseModel, - Address, - Alert, - AlertErrorDetails, - AlertList, - AsymmetricEncryptedSecret, - Authentication, - AzureContainerInfo, - BandwidthSchedule, - BandwidthSchedulesList, - ClientAccessRight, - CloudErrorBody, - ContactDetails, - Container, - ContainerList, - DataBoxEdgeDevice, - DataBoxEdgeDeviceExtendedInfo, - DataBoxEdgeDeviceList, - DataBoxEdgeDevicePatch, - FileEventTrigger, - FileSourceInfo, - IoTDeviceInfo, - IoTRole, - Ipv4Config, - Ipv6Config, - Job, - JobErrorDetails, - JobErrorItem, - MetricDimensionV1, - MetricSpecificationV1, - MountPointMap, - NetworkAdapter, - NetworkAdapterPosition, - NetworkSettings, - Node, - NodeList, - Operation, - OperationDisplay, - OperationsList, - Order, - OrderList, - OrderStatus, - PeriodicTimerEventTrigger, - PeriodicTimerSourceInfo, - RefreshDetails, - ResourceTypeSku, - Role, - RoleList, - RoleSinkInfo, - SecuritySettings, - ServiceSpecification, - Share, - ShareAccessRight, - ShareList, - Sku, - SkuCost, - SkuInformationList, - SkuLocationInfo, - SkuRestriction, - SkuRestrictionInfo, - StorageAccount, - StorageAccountCredential, - StorageAccountCredentialList, - StorageAccountList, - SymmetricKey, - TrackingInfo, - Trigger, - TriggerList, - UpdateDownloadProgress, - UpdateInstallProgress, - UpdateSummary, - UploadCertificateRequest, - UploadCertificateResponse, - User, - UserAccessRight, - UserList, -) - -from ._data_box_edge_management_client_enums import ( # type: ignore - AccountType, - AlertSeverity, - AuthenticationType, - AzureContainerDataFormat, - ClientPermissionType, - ContainerStatus, - DataBoxEdgeDeviceStatus, - DataPolicy, - DayOfWeek, - DeviceType, - DownloadPhase, - EncryptionAlgorithm, - InstallRebootBehavior, - JobStatus, - JobType, - MetricAggregationType, - MetricCategory, - MetricUnit, - MonitoringStatus, - NetworkAdapterDHCPStatus, - NetworkAdapterRDMAStatus, - NetworkAdapterStatus, - NetworkGroup, - NodeStatus, - OrderState, - PlatformType, - RoleStatus, - RoleTypes, - SSLStatus, - ShareAccessProtocol, - ShareAccessType, - ShareStatus, - SkuName, - SkuRestrictionReasonCode, - SkuTier, - StorageAccountStatus, - TimeGrain, - TriggerEventType, - UpdateOperation, - UpdateOperationStage, - UserType, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ARMBaseModel", - "Address", - "Alert", - "AlertErrorDetails", - "AlertList", - "AsymmetricEncryptedSecret", - "Authentication", - "AzureContainerInfo", - "BandwidthSchedule", - "BandwidthSchedulesList", - "ClientAccessRight", - "CloudErrorBody", - "ContactDetails", - "Container", - "ContainerList", - "DataBoxEdgeDevice", - "DataBoxEdgeDeviceExtendedInfo", - "DataBoxEdgeDeviceList", - "DataBoxEdgeDevicePatch", - "FileEventTrigger", - "FileSourceInfo", - "IoTDeviceInfo", - "IoTRole", - "Ipv4Config", - "Ipv6Config", - "Job", - "JobErrorDetails", - "JobErrorItem", - "MetricDimensionV1", - "MetricSpecificationV1", - "MountPointMap", - "NetworkAdapter", - "NetworkAdapterPosition", - "NetworkSettings", - "Node", - "NodeList", - "Operation", - "OperationDisplay", - "OperationsList", - "Order", - "OrderList", - "OrderStatus", - "PeriodicTimerEventTrigger", - "PeriodicTimerSourceInfo", - "RefreshDetails", - "ResourceTypeSku", - "Role", - "RoleList", - "RoleSinkInfo", - "SecuritySettings", - "ServiceSpecification", - "Share", - "ShareAccessRight", - "ShareList", - "Sku", - "SkuCost", - "SkuInformationList", - "SkuLocationInfo", - "SkuRestriction", - "SkuRestrictionInfo", - "StorageAccount", - "StorageAccountCredential", - "StorageAccountCredentialList", - "StorageAccountList", - "SymmetricKey", - "TrackingInfo", - "Trigger", - "TriggerList", - "UpdateDownloadProgress", - "UpdateInstallProgress", - "UpdateSummary", - "UploadCertificateRequest", - "UploadCertificateResponse", - "User", - "UserAccessRight", - "UserList", - "AccountType", - "AlertSeverity", - "AuthenticationType", - "AzureContainerDataFormat", - "ClientPermissionType", - "ContainerStatus", - "DataBoxEdgeDeviceStatus", - "DataPolicy", - "DayOfWeek", - "DeviceType", - "DownloadPhase", - "EncryptionAlgorithm", - "InstallRebootBehavior", - "JobStatus", - "JobType", - "MetricAggregationType", - "MetricCategory", - "MetricUnit", - "MonitoringStatus", - "NetworkAdapterDHCPStatus", - "NetworkAdapterRDMAStatus", - "NetworkAdapterStatus", - "NetworkGroup", - "NodeStatus", - "OrderState", - "PlatformType", - "RoleStatus", - "RoleTypes", - "SSLStatus", - "ShareAccessProtocol", - "ShareAccessType", - "ShareStatus", - "SkuName", - "SkuRestrictionReasonCode", - "SkuTier", - "StorageAccountStatus", - "TimeGrain", - "TriggerEventType", - "UpdateOperation", - "UpdateOperationStage", - "UserType", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_data_box_edge_management_client_enums.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_data_box_edge_management_client_enums.py deleted file mode 100644 index ccd430be8013..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_data_box_edge_management_client_enums.py +++ /dev/null @@ -1,391 +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 AccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of storage accessed on the storage account.""" - - GENERAL_PURPOSE_STORAGE = "GeneralPurposeStorage" - BLOB_STORAGE = "BlobStorage" - - -class AlertSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Severity of the alert.""" - - INFORMATIONAL = "Informational" - WARNING = "Warning" - CRITICAL = "Critical" - - -class AuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The authentication type.""" - - INVALID = "Invalid" - AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" - - -class AzureContainerDataFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Storage format used for the file represented by the share.""" - - BLOCK_BLOB = "BlockBlob" - PAGE_BLOB = "PageBlob" - AZURE_FILE = "AzureFile" - - -class ClientPermissionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of access to be allowed for the client.""" - - NO_ACCESS = "NoAccess" - READ_ONLY = "ReadOnly" - READ_WRITE = "ReadWrite" - - -class ContainerStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current status of the container.""" - - OK = "OK" - OFFLINE = "Offline" - UNKNOWN = "Unknown" - UPDATING = "Updating" - NEEDS_ATTENTION = "NeedsAttention" - - -class DataBoxEdgeDeviceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of the Data Box Edge/Gateway device.""" - - READY_TO_SETUP = "ReadyToSetup" - ONLINE = "Online" - OFFLINE = "Offline" - NEEDS_ATTENTION = "NeedsAttention" - DISCONNECTED = "Disconnected" - PARTIALLY_DISCONNECTED = "PartiallyDisconnected" - MAINTENANCE = "Maintenance" - - -class DataPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Data policy of the share.""" - - CLOUD = "Cloud" - LOCAL = "Local" - - -class DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DayOfWeek.""" - - SUNDAY = "Sunday" - MONDAY = "Monday" - TUESDAY = "Tuesday" - WEDNESDAY = "Wednesday" - THURSDAY = "Thursday" - FRIDAY = "Friday" - SATURDAY = "Saturday" - - -class DeviceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the Data Box Edge/Gateway device.""" - - DATA_BOX_EDGE_DEVICE = "DataBoxEdgeDevice" - - -class DownloadPhase(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The download phase.""" - - UNKNOWN = "Unknown" - INITIALIZING = "Initializing" - DOWNLOADING = "Downloading" - VERIFYING = "Verifying" - - -class EncryptionAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The algorithm used to encrypt "Value".""" - - NONE = "None" - AES256 = "AES256" - RSAES_PKCS1_V1_5 = "RSAES_PKCS1_v_1_5" - - -class InstallRebootBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates if updates are available and at least one of the updates needs a reboot.""" - - NEVER_REBOOTS = "NeverReboots" - REQUIRES_REBOOT = "RequiresReboot" - REQUEST_REBOOT = "RequestReboot" - - -class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current status of the job.""" - - INVALID = "Invalid" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - PAUSED = "Paused" - SCHEDULED = "Scheduled" - - -class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the job.""" - - INVALID = "Invalid" - SCAN_FOR_UPDATES = "ScanForUpdates" - DOWNLOAD_UPDATES = "DownloadUpdates" - INSTALL_UPDATES = "InstallUpdates" - REFRESH_SHARE = "RefreshShare" - REFRESH_CONTAINER = "RefreshContainer" - - -class MetricAggregationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric aggregation type.""" - - NOT_SPECIFIED = "NotSpecified" - NONE = "None" - AVERAGE = "Average" - MINIMUM = "Minimum" - MAXIMUM = "Maximum" - TOTAL = "Total" - COUNT = "Count" - - -class MetricCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric category.""" - - CAPACITY = "Capacity" - TRANSACTION = "Transaction" - - -class MetricUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metric units.""" - - NOT_SPECIFIED = "NotSpecified" - PERCENT = "Percent" - COUNT = "Count" - SECONDS = "Seconds" - MILLISECONDS = "Milliseconds" - BYTES = "Bytes" - BYTES_PER_SECOND = "BytesPerSecond" - COUNT_PER_SECOND = "CountPerSecond" - - -class MonitoringStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current monitoring status of the share.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class NetworkAdapterDHCPStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Value indicating whether this adapter has DHCP enabled.""" - - DISABLED = "Disabled" - ENABLED = "Enabled" - - -class NetworkAdapterRDMAStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Value indicating whether this adapter is RDMA capable.""" - - INCAPABLE = "Incapable" - CAPABLE = "Capable" - - -class NetworkAdapterStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Value indicating whether this adapter is valid.""" - - INACTIVE = "Inactive" - ACTIVE = "Active" - - -class NetworkGroup(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The network group.""" - - NONE = "None" - NON_RDMA = "NonRDMA" - RDMA = "RDMA" - - -class NodeStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current status of the individual node.""" - - UNKNOWN = "Unknown" - UP = "Up" - DOWN = "Down" - REBOOTING = "Rebooting" - SHUTTING_DOWN = "ShuttingDown" - - -class OrderState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the order as per the allowed status types.""" - - UNTRACKED = "Untracked" - AWAITING_FULFILMENT = "AwaitingFulfilment" - AWAITING_PREPARATION = "AwaitingPreparation" - AWAITING_SHIPMENT = "AwaitingShipment" - SHIPPED = "Shipped" - ARRIVING = "Arriving" - DELIVERED = "Delivered" - REPLACEMENT_REQUESTED = "ReplacementRequested" - LOST_DEVICE = "LostDevice" - DECLINED = "Declined" - RETURN_INITIATED = "ReturnInitiated" - AWAITING_RETURN_SHIPMENT = "AwaitingReturnShipment" - SHIPPED_BACK = "ShippedBack" - COLLECTED_AT_MICROSOFT = "CollectedAtMicrosoft" - - -class PlatformType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Host OS supported by the IoT role.""" - - WINDOWS = "Windows" - LINUX = "Linux" - - -class RoleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Role status.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class RoleTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """RoleTypes.""" - - IOT = "IOT" - ASA = "ASA" - FUNCTIONS = "Functions" - COGNITIVE = "Cognitive" - - -class ShareAccessProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Access protocol to be used by the share.""" - - SMB = "SMB" - NFS = "NFS" - - -class ShareAccessType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of access to be allowed on the share for this user.""" - - CHANGE = "Change" - READ = "Read" - CUSTOM = "Custom" - - -class ShareStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current status of the share.""" - - OFFLINE = "Offline" - UNKNOWN = "Unknown" - OK = "OK" - UPDATING = "Updating" - NEEDS_ATTENTION = "NeedsAttention" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Sku name.""" - - GATEWAY = "Gateway" - EDGE = "Edge" - TEA1_NODE = "TEA_1Node" - TEA1_NODE_UPS = "TEA_1Node_UPS" - TEA1_NODE_HEATER = "TEA_1Node_Heater" - TEA1_NODE_UPS_HEATER = "TEA_1Node_UPS_Heater" - TEA4_NODE_HEATER = "TEA_4Node_Heater" - TEA4_NODE_UPS_HEATER = "TEA_4Node_UPS_Heater" - TMA = "TMA" - - -class SkuRestrictionReasonCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The SKU restriction reason.""" - - NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" - QUOTA_ID = "QuotaId" - - -class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Sku tier.""" - - STANDARD = "Standard" - - -class SSLStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Signifies whether SSL needs to be enabled or not.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class StorageAccountStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current status of the storage account.""" - - OK = "OK" - OFFLINE = "Offline" - UNKNOWN = "Unknown" - UPDATING = "Updating" - NEEDS_ATTENTION = "NeedsAttention" - - -class TimeGrain(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """TimeGrain.""" - - PT1_M = "PT1M" - PT5_M = "PT5M" - PT15_M = "PT15M" - PT30_M = "PT30M" - PT1_H = "PT1H" - PT6_H = "PT6H" - PT12_H = "PT12H" - PT1_D = "PT1D" - - -class TriggerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Trigger Kind.""" - - FILE_EVENT = "FileEvent" - PERIODIC_TIMER_EVENT = "PeriodicTimerEvent" - - -class UpdateOperation(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current update operation.""" - - NONE = "None" - SCAN = "Scan" - DOWNLOAD = "Download" - INSTALL = "Install" - - -class UpdateOperationStage(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current stage of the update operation.""" - - UNKNOWN = "Unknown" - INITIAL = "Initial" - SCAN_STARTED = "ScanStarted" - SCAN_COMPLETE = "ScanComplete" - SCAN_FAILED = "ScanFailed" - DOWNLOAD_STARTED = "DownloadStarted" - DOWNLOAD_COMPLETE = "DownloadComplete" - DOWNLOAD_FAILED = "DownloadFailed" - INSTALL_STARTED = "InstallStarted" - INSTALL_COMPLETE = "InstallComplete" - INSTALL_FAILED = "InstallFailed" - REBOOT_INITIATED = "RebootInitiated" - SUCCESS = "Success" - FAILURE = "Failure" - RESCAN_STARTED = "RescanStarted" - RESCAN_COMPLETE = "RescanComplete" - RESCAN_FAILED = "RescanFailed" - - -class UserType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the user.""" - - SHARE = "Share" - LOCAL_MANAGEMENT = "LocalManagement" - ARM = "ARM" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models_py3.py deleted file mode 100644 index dafb7220dad7..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/models/_models_py3.py +++ /dev/null @@ -1,3805 +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 datetime -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union - -from ... import _serialization - -if TYPE_CHECKING: - from .. import models as _models - - -class Address(_serialization.Model): - """The shipping address of the customer. - - All required parameters must be populated in order to send to server. - - :ivar address_line1: The address line1. Required. - :vartype address_line1: str - :ivar address_line2: The address line2. - :vartype address_line2: str - :ivar address_line3: The address line3. - :vartype address_line3: str - :ivar postal_code: The postal code. Required. - :vartype postal_code: str - :ivar city: The city name. Required. - :vartype city: str - :ivar state: The state name. Required. - :vartype state: str - :ivar country: The country name. Required. - :vartype country: str - """ - - _validation = { - "address_line1": {"required": True}, - "postal_code": {"required": True}, - "city": {"required": True}, - "state": {"required": True}, - "country": {"required": True}, - } - - _attribute_map = { - "address_line1": {"key": "addressLine1", "type": "str"}, - "address_line2": {"key": "addressLine2", "type": "str"}, - "address_line3": {"key": "addressLine3", "type": "str"}, - "postal_code": {"key": "postalCode", "type": "str"}, - "city": {"key": "city", "type": "str"}, - "state": {"key": "state", "type": "str"}, - "country": {"key": "country", "type": "str"}, - } - - def __init__( - self, - *, - address_line1: str, - postal_code: str, - city: str, - state: str, - country: str, - address_line2: Optional[str] = None, - address_line3: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword address_line1: The address line1. Required. - :paramtype address_line1: str - :keyword address_line2: The address line2. - :paramtype address_line2: str - :keyword address_line3: The address line3. - :paramtype address_line3: str - :keyword postal_code: The postal code. Required. - :paramtype postal_code: str - :keyword city: The city name. Required. - :paramtype city: str - :keyword state: The state name. Required. - :paramtype state: str - :keyword country: The country name. Required. - :paramtype country: str - """ - super().__init__(**kwargs) - self.address_line1 = address_line1 - self.address_line2 = address_line2 - self.address_line3 = address_line3 - self.postal_code = postal_code - self.city = city - self.state = state - self.country = country - - -class ARMBaseModel(_serialization.Model): - """Represents the base class for all object models. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :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 Alert(ARMBaseModel): - """Alert on the data box edge/gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar title: Alert title. - :vartype title: str - :ivar alert_type: Alert type. - :vartype alert_type: str - :ivar appeared_at_date_time: UTC time when the alert appeared. - :vartype appeared_at_date_time: ~datetime.datetime - :ivar recommendation: Alert recommendation. - :vartype recommendation: str - :ivar severity: Severity of the alert. Known values are: "Informational", "Warning", and - "Critical". - :vartype severity: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AlertSeverity - :ivar error_details: Error details of the alert. - :vartype error_details: ~azure.mgmt.databoxedge.v2019_08_01.models.AlertErrorDetails - :ivar detailed_information: Alert details. - :vartype detailed_information: dict[str, str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "title": {"readonly": True}, - "alert_type": {"readonly": True}, - "appeared_at_date_time": {"readonly": True}, - "recommendation": {"readonly": True}, - "severity": {"readonly": True}, - "error_details": {"readonly": True}, - "detailed_information": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "title": {"key": "properties.title", "type": "str"}, - "alert_type": {"key": "properties.alertType", "type": "str"}, - "appeared_at_date_time": {"key": "properties.appearedAtDateTime", "type": "iso-8601"}, - "recommendation": {"key": "properties.recommendation", "type": "str"}, - "severity": {"key": "properties.severity", "type": "str"}, - "error_details": {"key": "properties.errorDetails", "type": "AlertErrorDetails"}, - "detailed_information": {"key": "properties.detailedInformation", "type": "{str}"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.title = None - self.alert_type = None - self.appeared_at_date_time = None - self.recommendation = None - self.severity = None - self.error_details = None - self.detailed_information = None - - -class AlertErrorDetails(_serialization.Model): - """Error details for the alert. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_code: Error code. - :vartype error_code: str - :ivar error_message: Error Message. - :vartype error_message: str - :ivar occurrences: Number of occurrences. - :vartype occurrences: int - """ - - _validation = { - "error_code": {"readonly": True}, - "error_message": {"readonly": True}, - "occurrences": {"readonly": True}, - } - - _attribute_map = { - "error_code": {"key": "errorCode", "type": "str"}, - "error_message": {"key": "errorMessage", "type": "str"}, - "occurrences": {"key": "occurrences", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.error_code = None - self.error_message = None - self.occurrences = None - - -class AlertList(_serialization.Model): - """Collection of alerts. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Alert] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Alert]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class AsymmetricEncryptedSecret(_serialization.Model): - """Represent the secrets intended for encryption with asymmetric key pair. - - All required parameters must be populated in order to send to server. - - :ivar value: The value of the secret. Required. - :vartype value: str - :ivar encryption_cert_thumbprint: Thumbprint certificate used to encrypt \\"Value\\". If the - value is unencrypted, it will be null. - :vartype encryption_cert_thumbprint: str - :ivar encryption_algorithm: The algorithm used to encrypt "Value". Required. Known values are: - "None", "AES256", and "RSAES_PKCS1_v_1_5". - :vartype encryption_algorithm: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.EncryptionAlgorithm - """ - - _validation = { - "value": {"required": True}, - "encryption_algorithm": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "str"}, - "encryption_cert_thumbprint": {"key": "encryptionCertThumbprint", "type": "str"}, - "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, - } - - def __init__( - self, - *, - value: str, - encryption_algorithm: Union[str, "_models.EncryptionAlgorithm"], - encryption_cert_thumbprint: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: The value of the secret. Required. - :paramtype value: str - :keyword encryption_cert_thumbprint: Thumbprint certificate used to encrypt \\"Value\\". If the - value is unencrypted, it will be null. - :paramtype encryption_cert_thumbprint: str - :keyword encryption_algorithm: The algorithm used to encrypt "Value". Required. Known values - are: "None", "AES256", and "RSAES_PKCS1_v_1_5". - :paramtype encryption_algorithm: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.EncryptionAlgorithm - """ - super().__init__(**kwargs) - self.value = value - self.encryption_cert_thumbprint = encryption_cert_thumbprint - self.encryption_algorithm = encryption_algorithm - - -class Authentication(_serialization.Model): - """Authentication mechanism for IoT devices. - - :ivar symmetric_key: Symmetric key for authentication. - :vartype symmetric_key: ~azure.mgmt.databoxedge.v2019_08_01.models.SymmetricKey - """ - - _attribute_map = { - "symmetric_key": {"key": "symmetricKey", "type": "SymmetricKey"}, - } - - def __init__(self, *, symmetric_key: Optional["_models.SymmetricKey"] = None, **kwargs: Any) -> None: - """ - :keyword symmetric_key: Symmetric key for authentication. - :paramtype symmetric_key: ~azure.mgmt.databoxedge.v2019_08_01.models.SymmetricKey - """ - super().__init__(**kwargs) - self.symmetric_key = symmetric_key - - -class AzureContainerInfo(_serialization.Model): - """Azure container mapping of the endpoint. - - All required parameters must be populated in order to send to server. - - :ivar storage_account_credential_id: ID of the storage account credential used to access - storage. Required. - :vartype storage_account_credential_id: str - :ivar container_name: Container name (Based on the data format specified, this represents the - name of Azure Files/Page blob/Block blob). Required. - :vartype container_name: str - :ivar data_format: Storage format used for the file represented by the share. Required. Known - values are: "BlockBlob", "PageBlob", and "AzureFile". - :vartype data_format: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerDataFormat - """ - - _validation = { - "storage_account_credential_id": {"required": True}, - "container_name": {"required": True}, - "data_format": {"required": True}, - } - - _attribute_map = { - "storage_account_credential_id": {"key": "storageAccountCredentialId", "type": "str"}, - "container_name": {"key": "containerName", "type": "str"}, - "data_format": {"key": "dataFormat", "type": "str"}, - } - - def __init__( - self, - *, - storage_account_credential_id: str, - container_name: str, - data_format: Union[str, "_models.AzureContainerDataFormat"], - **kwargs: Any - ) -> None: - """ - :keyword storage_account_credential_id: ID of the storage account credential used to access - storage. Required. - :paramtype storage_account_credential_id: str - :keyword container_name: Container name (Based on the data format specified, this represents - the name of Azure Files/Page blob/Block blob). Required. - :paramtype container_name: str - :keyword data_format: Storage format used for the file represented by the share. Required. - Known values are: "BlockBlob", "PageBlob", and "AzureFile". - :paramtype data_format: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerDataFormat - """ - super().__init__(**kwargs) - self.storage_account_credential_id = storage_account_credential_id - self.container_name = container_name - self.data_format = data_format - - -class BandwidthSchedule(ARMBaseModel): - """The bandwidth schedule details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar start: The start time of the schedule in UTC. Required. - :vartype start: str - :ivar stop: The stop time of the schedule in UTC. Required. - :vartype stop: str - :ivar rate_in_mbps: The bandwidth rate in Mbps. Required. - :vartype rate_in_mbps: int - :ivar days: The days of the week when this schedule is applicable. Required. - :vartype days: list[str or ~azure.mgmt.databoxedge.v2019_08_01.models.DayOfWeek] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "start": {"required": True}, - "stop": {"required": True}, - "rate_in_mbps": {"required": True}, - "days": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "start": {"key": "properties.start", "type": "str"}, - "stop": {"key": "properties.stop", "type": "str"}, - "rate_in_mbps": {"key": "properties.rateInMbps", "type": "int"}, - "days": {"key": "properties.days", "type": "[str]"}, - } - - def __init__( - self, *, start: str, stop: str, rate_in_mbps: int, days: List[Union[str, "_models.DayOfWeek"]], **kwargs: Any - ) -> None: - """ - :keyword start: The start time of the schedule in UTC. Required. - :paramtype start: str - :keyword stop: The stop time of the schedule in UTC. Required. - :paramtype stop: str - :keyword rate_in_mbps: The bandwidth rate in Mbps. Required. - :paramtype rate_in_mbps: int - :keyword days: The days of the week when this schedule is applicable. Required. - :paramtype days: list[str or ~azure.mgmt.databoxedge.v2019_08_01.models.DayOfWeek] - """ - super().__init__(**kwargs) - self.start = start - self.stop = stop - self.rate_in_mbps = rate_in_mbps - self.days = days - - -class BandwidthSchedulesList(_serialization.Model): - """The collection of bandwidth schedules. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of bandwidth schedules. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.BandwidthSchedule] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[BandwidthSchedule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class ClientAccessRight(_serialization.Model): - """The mapping between a particular client IP and the type of access client has on the NFS share. - - All required parameters must be populated in order to send to server. - - :ivar client: IP of the client. Required. - :vartype client: str - :ivar access_permission: Type of access to be allowed for the client. Required. Known values - are: "NoAccess", "ReadOnly", and "ReadWrite". - :vartype access_permission: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.ClientPermissionType - """ - - _validation = { - "client": {"required": True}, - "access_permission": {"required": True}, - } - - _attribute_map = { - "client": {"key": "client", "type": "str"}, - "access_permission": {"key": "accessPermission", "type": "str"}, - } - - def __init__( - self, *, client: str, access_permission: Union[str, "_models.ClientPermissionType"], **kwargs: Any - ) -> None: - """ - :keyword client: IP of the client. Required. - :paramtype client: str - :keyword access_permission: Type of access to be allowed for the client. Required. Known values - are: "NoAccess", "ReadOnly", and "ReadWrite". - :paramtype access_permission: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.ClientPermissionType - """ - super().__init__(**kwargs) - self.client = client - self.access_permission = access_permission - - -class CloudErrorBody(_serialization.Model): - """An error response from the service. - - :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed - programmatically. - :vartype code: str - :ivar message: A message describing the error, intended to be suitable for display in a user - interface. - :vartype message: str - :ivar details: A list of additional details about the error. - :vartype details: list[~azure.mgmt.databoxedge.v2019_08_01.models.CloudErrorBody] - """ - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "details": {"key": "details", "type": "[CloudErrorBody]"}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - details: Optional[List["_models.CloudErrorBody"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed - programmatically. - :paramtype code: str - :keyword message: A message describing the error, intended to be suitable for display in a user - interface. - :paramtype message: str - :keyword details: A list of additional details about the error. - :paramtype details: list[~azure.mgmt.databoxedge.v2019_08_01.models.CloudErrorBody] - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.details = details - - -class ContactDetails(_serialization.Model): - """Contains all the contact details of the customer. - - All required parameters must be populated in order to send to server. - - :ivar contact_person: The contact person name. Required. - :vartype contact_person: str - :ivar company_name: The name of the company. Required. - :vartype company_name: str - :ivar phone: The phone number. Required. - :vartype phone: str - :ivar email_list: The email list. Required. - :vartype email_list: list[str] - """ - - _validation = { - "contact_person": {"required": True}, - "company_name": {"required": True}, - "phone": {"required": True}, - "email_list": {"required": True}, - } - - _attribute_map = { - "contact_person": {"key": "contactPerson", "type": "str"}, - "company_name": {"key": "companyName", "type": "str"}, - "phone": {"key": "phone", "type": "str"}, - "email_list": {"key": "emailList", "type": "[str]"}, - } - - def __init__( - self, *, contact_person: str, company_name: str, phone: str, email_list: List[str], **kwargs: Any - ) -> None: - """ - :keyword contact_person: The contact person name. Required. - :paramtype contact_person: str - :keyword company_name: The name of the company. Required. - :paramtype company_name: str - :keyword phone: The phone number. Required. - :paramtype phone: str - :keyword email_list: The email list. Required. - :paramtype email_list: list[str] - """ - super().__init__(**kwargs) - self.contact_person = contact_person - self.company_name = company_name - self.phone = phone - self.email_list = email_list - - -class Container(ARMBaseModel): - """Represents a container on the Data Box Edge/Gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar container_status: Current status of the container. Known values are: "OK", "Offline", - "Unknown", "Updating", and "NeedsAttention". - :vartype container_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ContainerStatus - :ivar data_format: DataFormat for Container. Required. Known values are: "BlockBlob", - "PageBlob", and "AzureFile". - :vartype data_format: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerDataFormat - :ivar refresh_details: Details of the refresh job on this container. - :vartype refresh_details: ~azure.mgmt.databoxedge.v2019_08_01.models.RefreshDetails - :ivar created_date_time: The UTC time when container got created. - :vartype created_date_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "container_status": {"readonly": True}, - "data_format": {"required": True}, - "refresh_details": {"readonly": True}, - "created_date_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "container_status": {"key": "properties.containerStatus", "type": "str"}, - "data_format": {"key": "properties.dataFormat", "type": "str"}, - "refresh_details": {"key": "properties.refreshDetails", "type": "RefreshDetails"}, - "created_date_time": {"key": "properties.createdDateTime", "type": "iso-8601"}, - } - - def __init__(self, *, data_format: Union[str, "_models.AzureContainerDataFormat"], **kwargs: Any) -> None: - """ - :keyword data_format: DataFormat for Container. Required. Known values are: "BlockBlob", - "PageBlob", and "AzureFile". - :paramtype data_format: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerDataFormat - """ - super().__init__(**kwargs) - self.container_status = None - self.data_format = data_format - self.refresh_details = None - self.created_date_time = None - - -class ContainerList(_serialization.Model): - """Collection of all the containers on the Data Box Edge/Gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of containers. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Container] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Container]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class DataBoxEdgeDevice(ARMBaseModel): - """The Data Box Edge/Gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar location: The location of the device. This is a supported and registered Azure - geographical region (for example, West US, East US, or Southeast Asia). The geographical region - of a device cannot be changed once it is created, but if an identical geographical region is - specified on update, the request will succeed. Required. - :vartype location: str - :ivar tags: The list of tags that describe the device. These tags can be used to view and group - this device (across resource groups). - :vartype tags: dict[str, str] - :ivar sku: The SKU type. - :vartype sku: ~azure.mgmt.databoxedge.v2019_08_01.models.Sku - :ivar etag: The etag for the devices. - :vartype etag: str - :ivar data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Known values - are: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", - "PartiallyDisconnected", and "Maintenance". - :vartype data_box_edge_device_status: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceStatus - :ivar serial_number: The Serial Number of Data Box Edge/Gateway device. - :vartype serial_number: str - :ivar description: The Description of the Data Box Edge/Gateway device. - :vartype description: str - :ivar model_description: The description of the Data Box Edge/Gateway device model. - :vartype model_description: str - :ivar device_type: The type of the Data Box Edge/Gateway device. "DataBoxEdgeDevice" - :vartype device_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DeviceType - :ivar friendly_name: The Data Box Edge/Gateway device name. - :vartype friendly_name: str - :ivar culture: The Data Box Edge/Gateway device culture. - :vartype culture: str - :ivar device_model: The Data Box Edge/Gateway device model. - :vartype device_model: str - :ivar device_software_version: The Data Box Edge/Gateway device software version. - :vartype device_software_version: str - :ivar device_local_capacity: The Data Box Edge/Gateway device local capacity in MB. - :vartype device_local_capacity: int - :ivar time_zone: The Data Box Edge/Gateway device timezone. - :vartype time_zone: str - :ivar device_hcs_version: The device software version number of the device (eg: 1.2.18105.6). - :vartype device_hcs_version: str - :ivar configured_role_types: Type of compute roles configured. - :vartype configured_role_types: list[str or - ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes] - :ivar node_count: The number of nodes in the cluster. - :vartype node_count: int - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "serial_number": {"readonly": True}, - "device_type": {"readonly": True}, - "culture": {"readonly": True}, - "device_model": {"readonly": True}, - "device_software_version": {"readonly": True}, - "device_local_capacity": {"readonly": True}, - "time_zone": {"readonly": True}, - "device_hcs_version": {"readonly": True}, - "configured_role_types": {"readonly": True}, - "node_count": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "etag": {"key": "etag", "type": "str"}, - "data_box_edge_device_status": {"key": "properties.dataBoxEdgeDeviceStatus", "type": "str"}, - "serial_number": {"key": "properties.serialNumber", "type": "str"}, - "description": {"key": "properties.description", "type": "str"}, - "model_description": {"key": "properties.modelDescription", "type": "str"}, - "device_type": {"key": "properties.deviceType", "type": "str"}, - "friendly_name": {"key": "properties.friendlyName", "type": "str"}, - "culture": {"key": "properties.culture", "type": "str"}, - "device_model": {"key": "properties.deviceModel", "type": "str"}, - "device_software_version": {"key": "properties.deviceSoftwareVersion", "type": "str"}, - "device_local_capacity": {"key": "properties.deviceLocalCapacity", "type": "int"}, - "time_zone": {"key": "properties.timeZone", "type": "str"}, - "device_hcs_version": {"key": "properties.deviceHcsVersion", "type": "str"}, - "configured_role_types": {"key": "properties.configuredRoleTypes", "type": "[str]"}, - "node_count": {"key": "properties.nodeCount", "type": "int"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.Sku"] = None, - etag: Optional[str] = None, - data_box_edge_device_status: Optional[Union[str, "_models.DataBoxEdgeDeviceStatus"]] = None, - description: Optional[str] = None, - model_description: Optional[str] = None, - friendly_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the device. This is a supported and registered Azure - geographical region (for example, West US, East US, or Southeast Asia). The geographical region - of a device cannot be changed once it is created, but if an identical geographical region is - specified on update, the request will succeed. Required. - :paramtype location: str - :keyword tags: The list of tags that describe the device. These tags can be used to view and - group this device (across resource groups). - :paramtype tags: dict[str, str] - :keyword sku: The SKU type. - :paramtype sku: ~azure.mgmt.databoxedge.v2019_08_01.models.Sku - :keyword etag: The etag for the devices. - :paramtype etag: str - :keyword data_box_edge_device_status: The status of the Data Box Edge/Gateway device. Known - values are: "ReadyToSetup", "Online", "Offline", "NeedsAttention", "Disconnected", - "PartiallyDisconnected", and "Maintenance". - :paramtype data_box_edge_device_status: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceStatus - :keyword description: The Description of the Data Box Edge/Gateway device. - :paramtype description: str - :keyword model_description: The description of the Data Box Edge/Gateway device model. - :paramtype model_description: str - :keyword friendly_name: The Data Box Edge/Gateway device name. - :paramtype friendly_name: str - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - self.sku = sku - self.etag = etag - self.data_box_edge_device_status = data_box_edge_device_status - self.serial_number = None - self.description = description - self.model_description = model_description - self.device_type = None - self.friendly_name = friendly_name - self.culture = None - self.device_model = None - self.device_software_version = None - self.device_local_capacity = None - self.time_zone = None - self.device_hcs_version = None - self.configured_role_types = None - self.node_count = None - - -class DataBoxEdgeDeviceExtendedInfo(ARMBaseModel): - """The extended Info of the Data Box Edge/Gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar encryption_key_thumbprint: The digital signature of encrypted certificate. - :vartype encryption_key_thumbprint: str - :ivar encryption_key: The public part of the encryption certificate. Client uses this to - encrypt any secret. - :vartype encryption_key: str - :ivar resource_key: The Resource ID of the Resource. - :vartype resource_key: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource_key": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "encryption_key_thumbprint": {"key": "properties.encryptionKeyThumbprint", "type": "str"}, - "encryption_key": {"key": "properties.encryptionKey", "type": "str"}, - "resource_key": {"key": "properties.resourceKey", "type": "str"}, - } - - def __init__( - self, *, encryption_key_thumbprint: Optional[str] = None, encryption_key: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword encryption_key_thumbprint: The digital signature of encrypted certificate. - :paramtype encryption_key_thumbprint: str - :keyword encryption_key: The public part of the encryption certificate. Client uses this to - encrypt any secret. - :paramtype encryption_key: str - """ - super().__init__(**kwargs) - self.encryption_key_thumbprint = encryption_key_thumbprint - self.encryption_key = encryption_key - self.resource_key = None - - -class DataBoxEdgeDeviceList(_serialization.Model): - """The collection of Data Box Edge/Gateway devices. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Data Box Edge/Gateway devices. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DataBoxEdgeDevice]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class DataBoxEdgeDevicePatch(_serialization.Model): - """The Data Box Edge/Gateway device patch. - - :ivar tags: The tags attached to the Data Box Edge/Gateway resource. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: The tags attached to the Data Box Edge/Gateway resource. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class Trigger(ARMBaseModel): - """Trigger details. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FileEventTrigger, PeriodicTimerEventTrigger - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar kind: Trigger Kind. Required. Known values are: "FileEvent" and "PeriodicTimerEvent". - :vartype kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.TriggerEventType - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - } - - _subtype_map = {"kind": {"FileEvent": "FileEventTrigger", "PeriodicTimerEvent": "PeriodicTimerEventTrigger"}} - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - - -class FileEventTrigger(Trigger): - """Trigger details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar kind: Trigger Kind. Required. Known values are: "FileEvent" and "PeriodicTimerEvent". - :vartype kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.TriggerEventType - :ivar source_info: File event source details. Required. - :vartype source_info: ~azure.mgmt.databoxedge.v2019_08_01.models.FileSourceInfo - :ivar sink_info: Role sink info. Required. - :vartype sink_info: ~azure.mgmt.databoxedge.v2019_08_01.models.RoleSinkInfo - :ivar custom_context_tag: A custom context tag typically used to correlate the trigger against - its usage. For example, if a periodic timer trigger is intended for certain specific IoT - modules in the device, the tag can be the name or the image URL of the module. - :vartype custom_context_tag: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"required": True}, - "source_info": {"required": True}, - "sink_info": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "source_info": {"key": "properties.sourceInfo", "type": "FileSourceInfo"}, - "sink_info": {"key": "properties.sinkInfo", "type": "RoleSinkInfo"}, - "custom_context_tag": {"key": "properties.customContextTag", "type": "str"}, - } - - def __init__( - self, - *, - source_info: "_models.FileSourceInfo", - sink_info: "_models.RoleSinkInfo", - custom_context_tag: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword source_info: File event source details. Required. - :paramtype source_info: ~azure.mgmt.databoxedge.v2019_08_01.models.FileSourceInfo - :keyword sink_info: Role sink info. Required. - :paramtype sink_info: ~azure.mgmt.databoxedge.v2019_08_01.models.RoleSinkInfo - :keyword custom_context_tag: A custom context tag typically used to correlate the trigger - against its usage. For example, if a periodic timer trigger is intended for certain specific - IoT modules in the device, the tag can be the name or the image URL of the module. - :paramtype custom_context_tag: str - """ - super().__init__(**kwargs) - self.kind: str = "FileEvent" - self.source_info = source_info - self.sink_info = sink_info - self.custom_context_tag = custom_context_tag - - -class FileSourceInfo(_serialization.Model): - """File source details. - - All required parameters must be populated in order to send to server. - - :ivar share_id: File share ID. Required. - :vartype share_id: str - """ - - _validation = { - "share_id": {"required": True}, - } - - _attribute_map = { - "share_id": {"key": "shareId", "type": "str"}, - } - - def __init__(self, *, share_id: str, **kwargs: Any) -> None: - """ - :keyword share_id: File share ID. Required. - :paramtype share_id: str - """ - super().__init__(**kwargs) - self.share_id = share_id - - -class IoTDeviceInfo(_serialization.Model): - """Metadata of IoT device/IoT Edge device to be configured. - - All required parameters must be populated in order to send to server. - - :ivar device_id: ID of the IoT device/edge device. Required. - :vartype device_id: str - :ivar io_t_host_hub: Host name for the IoT hub associated to the device. Required. - :vartype io_t_host_hub: str - :ivar io_t_host_hub_id: Id for the IoT hub associated to the device. - :vartype io_t_host_hub_id: str - :ivar authentication: IoT device authentication info. - :vartype authentication: ~azure.mgmt.databoxedge.v2019_08_01.models.Authentication - """ - - _validation = { - "device_id": {"required": True}, - "io_t_host_hub": {"required": True}, - } - - _attribute_map = { - "device_id": {"key": "deviceId", "type": "str"}, - "io_t_host_hub": {"key": "ioTHostHub", "type": "str"}, - "io_t_host_hub_id": {"key": "ioTHostHubId", "type": "str"}, - "authentication": {"key": "authentication", "type": "Authentication"}, - } - - def __init__( - self, - *, - device_id: str, - io_t_host_hub: str, - io_t_host_hub_id: Optional[str] = None, - authentication: Optional["_models.Authentication"] = None, - **kwargs: Any - ) -> None: - """ - :keyword device_id: ID of the IoT device/edge device. Required. - :paramtype device_id: str - :keyword io_t_host_hub: Host name for the IoT hub associated to the device. Required. - :paramtype io_t_host_hub: str - :keyword io_t_host_hub_id: Id for the IoT hub associated to the device. - :paramtype io_t_host_hub_id: str - :keyword authentication: IoT device authentication info. - :paramtype authentication: ~azure.mgmt.databoxedge.v2019_08_01.models.Authentication - """ - super().__init__(**kwargs) - self.device_id = device_id - self.io_t_host_hub = io_t_host_hub - self.io_t_host_hub_id = io_t_host_hub_id - self.authentication = authentication - - -class Role(ARMBaseModel): - """Compute role. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - IoTRole - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar kind: Role type. Required. Known values are: "IOT", "ASA", "Functions", and "Cognitive". - :vartype kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - } - - _subtype_map = {"kind": {"IOT": "IoTRole"}} - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - - -class IoTRole(Role): - """Compute role. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar kind: Role type. Required. Known values are: "IOT", "ASA", "Functions", and "Cognitive". - :vartype kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes - :ivar host_platform: Host OS supported by the IoT role. Known values are: "Windows" and - "Linux". - :vartype host_platform: str or ~azure.mgmt.databoxedge.v2019_08_01.models.PlatformType - :ivar io_t_device_details: IoT device metadata to which data box edge device needs to be - connected. - :vartype io_t_device_details: ~azure.mgmt.databoxedge.v2019_08_01.models.IoTDeviceInfo - :ivar io_t_edge_device_details: IoT edge device to which the IoT role needs to be configured. - :vartype io_t_edge_device_details: ~azure.mgmt.databoxedge.v2019_08_01.models.IoTDeviceInfo - :ivar share_mappings: Mount points of shares in role(s). - :vartype share_mappings: list[~azure.mgmt.databoxedge.v2019_08_01.models.MountPointMap] - :ivar role_status: Role status. Known values are: "Enabled" and "Disabled". - :vartype role_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "host_platform": {"key": "properties.hostPlatform", "type": "str"}, - "io_t_device_details": {"key": "properties.ioTDeviceDetails", "type": "IoTDeviceInfo"}, - "io_t_edge_device_details": {"key": "properties.ioTEdgeDeviceDetails", "type": "IoTDeviceInfo"}, - "share_mappings": {"key": "properties.shareMappings", "type": "[MountPointMap]"}, - "role_status": {"key": "properties.roleStatus", "type": "str"}, - } - - def __init__( - self, - *, - host_platform: Optional[Union[str, "_models.PlatformType"]] = None, - io_t_device_details: Optional["_models.IoTDeviceInfo"] = None, - io_t_edge_device_details: Optional["_models.IoTDeviceInfo"] = None, - share_mappings: Optional[List["_models.MountPointMap"]] = None, - role_status: Optional[Union[str, "_models.RoleStatus"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword host_platform: Host OS supported by the IoT role. Known values are: "Windows" and - "Linux". - :paramtype host_platform: str or ~azure.mgmt.databoxedge.v2019_08_01.models.PlatformType - :keyword io_t_device_details: IoT device metadata to which data box edge device needs to be - connected. - :paramtype io_t_device_details: ~azure.mgmt.databoxedge.v2019_08_01.models.IoTDeviceInfo - :keyword io_t_edge_device_details: IoT edge device to which the IoT role needs to be - configured. - :paramtype io_t_edge_device_details: ~azure.mgmt.databoxedge.v2019_08_01.models.IoTDeviceInfo - :keyword share_mappings: Mount points of shares in role(s). - :paramtype share_mappings: list[~azure.mgmt.databoxedge.v2019_08_01.models.MountPointMap] - :keyword role_status: Role status. Known values are: "Enabled" and "Disabled". - :paramtype role_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleStatus - """ - super().__init__(**kwargs) - self.kind: str = "IOT" - self.host_platform = host_platform - self.io_t_device_details = io_t_device_details - self.io_t_edge_device_details = io_t_edge_device_details - self.share_mappings = share_mappings - self.role_status = role_status - - -class Ipv4Config(_serialization.Model): - """Details related to the IPv4 address configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ip_address: The IPv4 address of the network adapter. - :vartype ip_address: str - :ivar subnet: The IPv4 subnet of the network adapter. - :vartype subnet: str - :ivar gateway: The IPv4 gateway of the network adapter. - :vartype gateway: str - """ - - _validation = { - "ip_address": {"readonly": True}, - "subnet": {"readonly": True}, - "gateway": {"readonly": True}, - } - - _attribute_map = { - "ip_address": {"key": "ipAddress", "type": "str"}, - "subnet": {"key": "subnet", "type": "str"}, - "gateway": {"key": "gateway", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.ip_address = None - self.subnet = None - self.gateway = None - - -class Ipv6Config(_serialization.Model): - """Details related to the IPv6 address configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ip_address: The IPv6 address of the network adapter. - :vartype ip_address: str - :ivar prefix_length: The IPv6 prefix of the network adapter. - :vartype prefix_length: int - :ivar gateway: The IPv6 gateway of the network adapter. - :vartype gateway: str - """ - - _validation = { - "ip_address": {"readonly": True}, - "prefix_length": {"readonly": True}, - "gateway": {"readonly": True}, - } - - _attribute_map = { - "ip_address": {"key": "ipAddress", "type": "str"}, - "prefix_length": {"key": "prefixLength", "type": "int"}, - "gateway": {"key": "gateway", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.ip_address = None - self.prefix_length = None - self.gateway = None - - -class Job(_serialization.Model): - """A device job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The name of the object. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar status: The current status of the job. Known values are: "Invalid", "Running", - "Succeeded", "Failed", "Canceled", "Paused", and "Scheduled". - :vartype status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.JobStatus - :ivar start_time: The UTC date and time at which the job started. - :vartype start_time: ~datetime.datetime - :ivar end_time: The UTC date and time at which the job completed. - :vartype end_time: ~datetime.datetime - :ivar percent_complete: The percentage of the job that is complete. - :vartype percent_complete: int - :ivar error: The error details. - :vartype error: ~azure.mgmt.databoxedge.v2019_08_01.models.JobErrorDetails - :ivar job_type: The type of the job. Known values are: "Invalid", "ScanForUpdates", - "DownloadUpdates", "InstallUpdates", "RefreshShare", and "RefreshContainer". - :vartype job_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.JobType - :ivar current_stage: Current stage of the update operation. Known values are: "Unknown", - "Initial", "ScanStarted", "ScanComplete", "ScanFailed", "DownloadStarted", "DownloadComplete", - "DownloadFailed", "InstallStarted", "InstallComplete", "InstallFailed", "RebootInitiated", - "Success", "Failure", "RescanStarted", "RescanComplete", and "RescanFailed". - :vartype current_stage: str or ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateOperationStage - :ivar download_progress: The download progress. - :vartype download_progress: ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateDownloadProgress - :ivar install_progress: The install progress. - :vartype install_progress: ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateInstallProgress - :ivar total_refresh_errors: Total number of errors encountered during the refresh process. - :vartype total_refresh_errors: int - :ivar error_manifest_file: Local share/remote container relative path to the error manifest - file of the refresh. - :vartype error_manifest_file: str - :ivar refreshed_entity_id: ARM ID of the entity that was refreshed. - :vartype refreshed_entity_id: str - :ivar folder: If only subfolders need to be refreshed, then the subfolder path inside the share - or container. (The path is empty if there are no subfolders.). - :vartype folder: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "status": {"readonly": True}, - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - "percent_complete": {"readonly": True}, - "error": {"readonly": True}, - "job_type": {"readonly": True}, - "current_stage": {"readonly": True}, - "download_progress": {"readonly": True}, - "install_progress": {"readonly": True}, - "total_refresh_errors": {"readonly": True}, - "error_manifest_file": {"readonly": True}, - "refreshed_entity_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "start_time": {"key": "startTime", "type": "iso-8601"}, - "end_time": {"key": "endTime", "type": "iso-8601"}, - "percent_complete": {"key": "percentComplete", "type": "int"}, - "error": {"key": "error", "type": "JobErrorDetails"}, - "job_type": {"key": "properties.jobType", "type": "str"}, - "current_stage": {"key": "properties.currentStage", "type": "str"}, - "download_progress": {"key": "properties.downloadProgress", "type": "UpdateDownloadProgress"}, - "install_progress": {"key": "properties.installProgress", "type": "UpdateInstallProgress"}, - "total_refresh_errors": {"key": "properties.totalRefreshErrors", "type": "int"}, - "error_manifest_file": {"key": "properties.errorManifestFile", "type": "str"}, - "refreshed_entity_id": {"key": "properties.refreshedEntityId", "type": "str"}, - "folder": {"key": "properties.folder", "type": "str"}, - } - - def __init__(self, *, folder: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword folder: If only subfolders need to be refreshed, then the subfolder path inside the - share or container. (The path is empty if there are no subfolders.). - :paramtype folder: str - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.status = None - self.start_time = None - self.end_time = None - self.percent_complete = None - self.error = None - self.job_type = None - self.current_stage = None - self.download_progress = None - self.install_progress = None - self.total_refresh_errors = None - self.error_manifest_file = None - self.refreshed_entity_id = None - self.folder = folder - - -class JobErrorDetails(_serialization.Model): - """The job error information containing the list of job errors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_details: The error details. - :vartype error_details: list[~azure.mgmt.databoxedge.v2019_08_01.models.JobErrorItem] - :ivar code: The code intended for programmatic access. - :vartype code: str - :ivar message: The message that describes the error in detail. - :vartype message: str - """ - - _validation = { - "error_details": {"readonly": True}, - "code": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "error_details": {"key": "errorDetails", "type": "[JobErrorItem]"}, - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.error_details = None - self.code = None - self.message = None - - -class JobErrorItem(_serialization.Model): - """The job error items. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar recommendations: The recommended actions. - :vartype recommendations: list[str] - :ivar code: The code intended for programmatic access. - :vartype code: str - :ivar message: The message that describes the error in detail. - :vartype message: str - """ - - _validation = { - "recommendations": {"readonly": True}, - "code": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "recommendations": {"key": "recommendations", "type": "[str]"}, - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.recommendations = None - self.code = None - self.message = None - - -class MetricDimensionV1(_serialization.Model): - """Metric Dimension v1. - - :ivar name: Name of the metrics dimension. - :vartype name: str - :ivar display_name: Display name of the metrics dimension. - :vartype display_name: str - :ivar to_be_exported_for_shoebox: To be exported to shoe box. - :vartype to_be_exported_for_shoebox: bool - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "to_be_exported_for_shoebox": {"key": "toBeExportedForShoebox", "type": "bool"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - to_be_exported_for_shoebox: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the metrics dimension. - :paramtype name: str - :keyword display_name: Display name of the metrics dimension. - :paramtype display_name: str - :keyword to_be_exported_for_shoebox: To be exported to shoe box. - :paramtype to_be_exported_for_shoebox: bool - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.to_be_exported_for_shoebox = to_be_exported_for_shoebox - - -class MetricSpecificationV1(_serialization.Model): - """Metric specification version 1. - - :ivar name: Name of the metric. - :vartype name: str - :ivar display_name: Display name of the metric. - :vartype display_name: str - :ivar display_description: Description of the metric to be displayed. - :vartype display_description: str - :ivar unit: Metric units. Known values are: "NotSpecified", "Percent", "Count", "Seconds", - "Milliseconds", "Bytes", "BytesPerSecond", and "CountPerSecond". - :vartype unit: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MetricUnit - :ivar aggregation_type: Metric aggregation type. Known values are: "NotSpecified", "None", - "Average", "Minimum", "Maximum", "Total", and "Count". - :vartype aggregation_type: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.MetricAggregationType - :ivar dimensions: Metric dimensions, other than default dimension which is resource. - :vartype dimensions: list[~azure.mgmt.databoxedge.v2019_08_01.models.MetricDimensionV1] - :ivar fill_gap_with_zero: Set true to fill the gaps with zero. - :vartype fill_gap_with_zero: bool - :ivar category: Metric category. Known values are: "Capacity" and "Transaction". - :vartype category: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MetricCategory - :ivar resource_id_dimension_name_override: Resource name override. - :vartype resource_id_dimension_name_override: str - :ivar supported_time_grain_types: Support granularity of metrics. - :vartype supported_time_grain_types: list[str or - ~azure.mgmt.databoxedge.v2019_08_01.models.TimeGrain] - :ivar supported_aggregation_types: Support metric aggregation type. - :vartype supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.v2019_08_01.models.MetricAggregationType] - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "display_description": {"key": "displayDescription", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "aggregation_type": {"key": "aggregationType", "type": "str"}, - "dimensions": {"key": "dimensions", "type": "[MetricDimensionV1]"}, - "fill_gap_with_zero": {"key": "fillGapWithZero", "type": "bool"}, - "category": {"key": "category", "type": "str"}, - "resource_id_dimension_name_override": {"key": "resourceIdDimensionNameOverride", "type": "str"}, - "supported_time_grain_types": {"key": "supportedTimeGrainTypes", "type": "[str]"}, - "supported_aggregation_types": {"key": "supportedAggregationTypes", "type": "[str]"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - display_description: Optional[str] = None, - unit: Optional[Union[str, "_models.MetricUnit"]] = None, - aggregation_type: Optional[Union[str, "_models.MetricAggregationType"]] = None, - dimensions: Optional[List["_models.MetricDimensionV1"]] = None, - fill_gap_with_zero: Optional[bool] = None, - category: Optional[Union[str, "_models.MetricCategory"]] = None, - resource_id_dimension_name_override: Optional[str] = None, - supported_time_grain_types: Optional[List[Union[str, "_models.TimeGrain"]]] = None, - supported_aggregation_types: Optional[List[Union[str, "_models.MetricAggregationType"]]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the metric. - :paramtype name: str - :keyword display_name: Display name of the metric. - :paramtype display_name: str - :keyword display_description: Description of the metric to be displayed. - :paramtype display_description: str - :keyword unit: Metric units. Known values are: "NotSpecified", "Percent", "Count", "Seconds", - "Milliseconds", "Bytes", "BytesPerSecond", and "CountPerSecond". - :paramtype unit: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MetricUnit - :keyword aggregation_type: Metric aggregation type. Known values are: "NotSpecified", "None", - "Average", "Minimum", "Maximum", "Total", and "Count". - :paramtype aggregation_type: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.MetricAggregationType - :keyword dimensions: Metric dimensions, other than default dimension which is resource. - :paramtype dimensions: list[~azure.mgmt.databoxedge.v2019_08_01.models.MetricDimensionV1] - :keyword fill_gap_with_zero: Set true to fill the gaps with zero. - :paramtype fill_gap_with_zero: bool - :keyword category: Metric category. Known values are: "Capacity" and "Transaction". - :paramtype category: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MetricCategory - :keyword resource_id_dimension_name_override: Resource name override. - :paramtype resource_id_dimension_name_override: str - :keyword supported_time_grain_types: Support granularity of metrics. - :paramtype supported_time_grain_types: list[str or - ~azure.mgmt.databoxedge.v2019_08_01.models.TimeGrain] - :keyword supported_aggregation_types: Support metric aggregation type. - :paramtype supported_aggregation_types: list[str or - ~azure.mgmt.databoxedge.v2019_08_01.models.MetricAggregationType] - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.dimensions = dimensions - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override - self.supported_time_grain_types = supported_time_grain_types - self.supported_aggregation_types = supported_aggregation_types - - -class MountPointMap(_serialization.Model): - """The share mount point. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar share_id: ID of the share mounted to the role VM. Required. - :vartype share_id: str - :ivar role_id: ID of the role to which share is mounted. - :vartype role_id: str - :ivar mount_point: Mount point for the share. - :vartype mount_point: str - :ivar role_type: Role type. Known values are: "IOT", "ASA", "Functions", and "Cognitive". - :vartype role_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.RoleTypes - """ - - _validation = { - "share_id": {"required": True}, - "role_id": {"readonly": True}, - "mount_point": {"readonly": True}, - "role_type": {"readonly": True}, - } - - _attribute_map = { - "share_id": {"key": "shareId", "type": "str"}, - "role_id": {"key": "roleId", "type": "str"}, - "mount_point": {"key": "mountPoint", "type": "str"}, - "role_type": {"key": "roleType", "type": "str"}, - } - - def __init__(self, *, share_id: str, **kwargs: Any) -> None: - """ - :keyword share_id: ID of the share mounted to the role VM. Required. - :paramtype share_id: str - """ - super().__init__(**kwargs) - self.share_id = share_id - self.role_id = None - self.mount_point = None - self.role_type = None - - -class NetworkAdapter(_serialization.Model): - """Represents the networkAdapter on a device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar adapter_id: Instance ID of network adapter. - :vartype adapter_id: str - :ivar adapter_position: Hardware position of network adapter. - :vartype adapter_position: ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterPosition - :ivar index: Logical index of the adapter. - :vartype index: int - :ivar node_id: Node ID of the network adapter. - :vartype node_id: str - :ivar network_adapter_name: Network adapter name. - :vartype network_adapter_name: str - :ivar label: Hardware label for the adapter. - :vartype label: str - :ivar mac_address: MAC address. - :vartype mac_address: str - :ivar link_speed: Link speed. - :vartype link_speed: int - :ivar status: Value indicating whether this adapter is valid. Known values are: "Inactive" and - "Active". - :vartype status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterStatus - :ivar rdma_status: Value indicating whether this adapter is RDMA capable. Known values are: - "Incapable" and "Capable". - :vartype rdma_status: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterRDMAStatus - :ivar dhcp_status: Value indicating whether this adapter has DHCP enabled. Known values are: - "Disabled" and "Enabled". - :vartype dhcp_status: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterDHCPStatus - :ivar ipv4_configuration: The IPv4 configuration of the network adapter. - :vartype ipv4_configuration: ~azure.mgmt.databoxedge.v2019_08_01.models.Ipv4Config - :ivar ipv6_configuration: The IPv6 configuration of the network adapter. - :vartype ipv6_configuration: ~azure.mgmt.databoxedge.v2019_08_01.models.Ipv6Config - :ivar ipv6_link_local_address: The IPv6 local address. - :vartype ipv6_link_local_address: str - :ivar dns_servers: The list of DNS Servers of the device. - :vartype dns_servers: list[str] - """ - - _validation = { - "adapter_id": {"readonly": True}, - "adapter_position": {"readonly": True}, - "index": {"readonly": True}, - "node_id": {"readonly": True}, - "network_adapter_name": {"readonly": True}, - "label": {"readonly": True}, - "mac_address": {"readonly": True}, - "link_speed": {"readonly": True}, - "status": {"readonly": True}, - "ipv4_configuration": {"readonly": True}, - "ipv6_configuration": {"readonly": True}, - "ipv6_link_local_address": {"readonly": True}, - "dns_servers": {"readonly": True}, - } - - _attribute_map = { - "adapter_id": {"key": "adapterId", "type": "str"}, - "adapter_position": {"key": "adapterPosition", "type": "NetworkAdapterPosition"}, - "index": {"key": "index", "type": "int"}, - "node_id": {"key": "nodeId", "type": "str"}, - "network_adapter_name": {"key": "networkAdapterName", "type": "str"}, - "label": {"key": "label", "type": "str"}, - "mac_address": {"key": "macAddress", "type": "str"}, - "link_speed": {"key": "linkSpeed", "type": "int"}, - "status": {"key": "status", "type": "str"}, - "rdma_status": {"key": "rdmaStatus", "type": "str"}, - "dhcp_status": {"key": "dhcpStatus", "type": "str"}, - "ipv4_configuration": {"key": "ipv4Configuration", "type": "Ipv4Config"}, - "ipv6_configuration": {"key": "ipv6Configuration", "type": "Ipv6Config"}, - "ipv6_link_local_address": {"key": "ipv6LinkLocalAddress", "type": "str"}, - "dns_servers": {"key": "dnsServers", "type": "[str]"}, - } - - def __init__( - self, - *, - rdma_status: Optional[Union[str, "_models.NetworkAdapterRDMAStatus"]] = None, - dhcp_status: Optional[Union[str, "_models.NetworkAdapterDHCPStatus"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword rdma_status: Value indicating whether this adapter is RDMA capable. Known values are: - "Incapable" and "Capable". - :paramtype rdma_status: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterRDMAStatus - :keyword dhcp_status: Value indicating whether this adapter has DHCP enabled. Known values are: - "Disabled" and "Enabled". - :paramtype dhcp_status: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapterDHCPStatus - """ - super().__init__(**kwargs) - self.adapter_id = None - self.adapter_position = None - self.index = None - self.node_id = None - self.network_adapter_name = None - self.label = None - self.mac_address = None - self.link_speed = None - self.status = None - self.rdma_status = rdma_status - self.dhcp_status = dhcp_status - self.ipv4_configuration = None - self.ipv6_configuration = None - self.ipv6_link_local_address = None - self.dns_servers = None - - -class NetworkAdapterPosition(_serialization.Model): - """The network adapter position. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar network_group: The network group. Known values are: "None", "NonRDMA", and "RDMA". - :vartype network_group: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkGroup - :ivar port: The port. - :vartype port: int - """ - - _validation = { - "network_group": {"readonly": True}, - "port": {"readonly": True}, - } - - _attribute_map = { - "network_group": {"key": "networkGroup", "type": "str"}, - "port": {"key": "port", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.network_group = None - self.port = None - - -class NetworkSettings(ARMBaseModel): - """The network settings of a device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar network_adapters: The network adapter list on the device. - :vartype network_adapters: list[~azure.mgmt.databoxedge.v2019_08_01.models.NetworkAdapter] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "network_adapters": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "network_adapters": {"key": "properties.networkAdapters", "type": "[NetworkAdapter]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.network_adapters = None - - -class Node(ARMBaseModel): - """Represents a single node in a Data box Edge/Gateway device - Gateway devices, standalone Edge devices and a single node cluster Edge device will all have 1 - node - Multi-node Edge devices will have more than 1 nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar node_status: The current status of the individual node. Known values are: "Unknown", - "Up", "Down", "Rebooting", and "ShuttingDown". - :vartype node_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.NodeStatus - :ivar node_chassis_serial_number: Serial number of the Chassis. - :vartype node_chassis_serial_number: str - :ivar node_serial_number: Serial number of the individual node. - :vartype node_serial_number: str - :ivar node_display_name: Display Name of the individual node. - :vartype node_display_name: str - :ivar node_friendly_software_version: Friendly software version name that is currently - installed on the node. - :vartype node_friendly_software_version: str - :ivar node_hcs_version: HCS version that is currently installed on the node. - :vartype node_hcs_version: str - :ivar node_instance_id: Guid instance id of the node. - :vartype node_instance_id: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "node_status": {"readonly": True}, - "node_chassis_serial_number": {"readonly": True}, - "node_serial_number": {"readonly": True}, - "node_display_name": {"readonly": True}, - "node_friendly_software_version": {"readonly": True}, - "node_hcs_version": {"readonly": True}, - "node_instance_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "node_status": {"key": "properties.nodeStatus", "type": "str"}, - "node_chassis_serial_number": {"key": "properties.nodeChassisSerialNumber", "type": "str"}, - "node_serial_number": {"key": "properties.nodeSerialNumber", "type": "str"}, - "node_display_name": {"key": "properties.nodeDisplayName", "type": "str"}, - "node_friendly_software_version": {"key": "properties.nodeFriendlySoftwareVersion", "type": "str"}, - "node_hcs_version": {"key": "properties.nodeHcsVersion", "type": "str"}, - "node_instance_id": {"key": "properties.nodeInstanceId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.node_status = None - self.node_chassis_serial_number = None - self.node_serial_number = None - self.node_display_name = None - self.node_friendly_software_version = None - self.node_hcs_version = None - self.node_instance_id = None - - -class NodeList(_serialization.Model): - """Collection of Nodes. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Nodes. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Node] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Node]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class Operation(_serialization.Model): - """Operations. - - :ivar name: Name of the operation. - :vartype name: str - :ivar display: Properties displayed for the operation. - :vartype display: ~azure.mgmt.databoxedge.v2019_08_01.models.OperationDisplay - :ivar origin: Origin of the operation. - :vartype origin: str - :ivar service_specification: Service specification. - :vartype service_specification: ~azure.mgmt.databoxedge.v2019_08_01.models.ServiceSpecification - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "service_specification": {"key": "properties.serviceSpecification", "type": "ServiceSpecification"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display: Optional["_models.OperationDisplay"] = None, - origin: Optional[str] = None, - service_specification: Optional["_models.ServiceSpecification"] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the operation. - :paramtype name: str - :keyword display: Properties displayed for the operation. - :paramtype display: ~azure.mgmt.databoxedge.v2019_08_01.models.OperationDisplay - :keyword origin: Origin of the operation. - :paramtype origin: str - :keyword service_specification: Service specification. - :paramtype service_specification: - ~azure.mgmt.databoxedge.v2019_08_01.models.ServiceSpecification - """ - super().__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification - - -class OperationDisplay(_serialization.Model): - """Operation display properties. - - :ivar provider: Provider name. - :vartype provider: str - :ivar resource: The type of resource in which the operation is performed. - :vartype resource: str - :ivar operation: Operation to be performed on the resource. - :vartype operation: str - :ivar description: Description of the operation to be performed. - :vartype description: str - """ - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__( - self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword provider: Provider name. - :paramtype provider: str - :keyword resource: The type of resource in which the operation is performed. - :paramtype resource: str - :keyword operation: Operation to be performed on the resource. - :paramtype operation: str - :keyword description: Description of the operation to be performed. - :paramtype description: str - """ - super().__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class OperationsList(_serialization.Model): - """The list of operations used for the discovery of available provider operations. - - All required parameters must be populated in order to send to server. - - :ivar value: The value. Required. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Operation] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Operation"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The value. Required. - :paramtype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Operation] - :keyword next_link: Link to the next set of results. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class Order(ARMBaseModel): - """The order details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar contact_information: The contact details. - :vartype contact_information: ~azure.mgmt.databoxedge.v2019_08_01.models.ContactDetails - :ivar shipping_address: The shipping address. - :vartype shipping_address: ~azure.mgmt.databoxedge.v2019_08_01.models.Address - :ivar current_status: Current status of the order. - :vartype current_status: ~azure.mgmt.databoxedge.v2019_08_01.models.OrderStatus - :ivar order_history: List of status changes in the order. - :vartype order_history: list[~azure.mgmt.databoxedge.v2019_08_01.models.OrderStatus] - :ivar serial_number: Serial number of the device. - :vartype serial_number: str - :ivar delivery_tracking_info: Tracking information for the package delivered to the customer - whether it has an original or a replacement device. - :vartype delivery_tracking_info: list[~azure.mgmt.databoxedge.v2019_08_01.models.TrackingInfo] - :ivar return_tracking_info: Tracking information for the package returned from the customer - whether it has an original or a replacement device. - :vartype return_tracking_info: list[~azure.mgmt.databoxedge.v2019_08_01.models.TrackingInfo] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "order_history": {"readonly": True}, - "serial_number": {"readonly": True}, - "delivery_tracking_info": {"readonly": True}, - "return_tracking_info": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "contact_information": {"key": "properties.contactInformation", "type": "ContactDetails"}, - "shipping_address": {"key": "properties.shippingAddress", "type": "Address"}, - "current_status": {"key": "properties.currentStatus", "type": "OrderStatus"}, - "order_history": {"key": "properties.orderHistory", "type": "[OrderStatus]"}, - "serial_number": {"key": "properties.serialNumber", "type": "str"}, - "delivery_tracking_info": {"key": "properties.deliveryTrackingInfo", "type": "[TrackingInfo]"}, - "return_tracking_info": {"key": "properties.returnTrackingInfo", "type": "[TrackingInfo]"}, - } - - def __init__( - self, - *, - contact_information: Optional["_models.ContactDetails"] = None, - shipping_address: Optional["_models.Address"] = None, - current_status: Optional["_models.OrderStatus"] = None, - **kwargs: Any - ) -> None: - """ - :keyword contact_information: The contact details. - :paramtype contact_information: ~azure.mgmt.databoxedge.v2019_08_01.models.ContactDetails - :keyword shipping_address: The shipping address. - :paramtype shipping_address: ~azure.mgmt.databoxedge.v2019_08_01.models.Address - :keyword current_status: Current status of the order. - :paramtype current_status: ~azure.mgmt.databoxedge.v2019_08_01.models.OrderStatus - """ - super().__init__(**kwargs) - self.contact_information = contact_information - self.shipping_address = shipping_address - self.current_status = current_status - self.order_history = None - self.serial_number = None - self.delivery_tracking_info = None - self.return_tracking_info = None - - -class OrderList(_serialization.Model): - """List of order entities. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of orders. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Order] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Order]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class OrderStatus(_serialization.Model): - """Represents a single status change. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar status: Status of the order as per the allowed status types. Required. Known values are: - "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", - "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", - "AwaitingReturnShipment", "ShippedBack", and "CollectedAtMicrosoft". - :vartype status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.OrderState - :ivar update_date_time: Time of status update. - :vartype update_date_time: ~datetime.datetime - :ivar comments: Comments related to this status change. - :vartype comments: str - :ivar additional_order_details: Dictionary to hold generic information which is not stored - by the already existing properties. - :vartype additional_order_details: dict[str, str] - """ - - _validation = { - "status": {"required": True}, - "update_date_time": {"readonly": True}, - "additional_order_details": {"readonly": True}, - } - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "update_date_time": {"key": "updateDateTime", "type": "iso-8601"}, - "comments": {"key": "comments", "type": "str"}, - "additional_order_details": {"key": "additionalOrderDetails", "type": "{str}"}, - } - - def __init__( - self, *, status: Union[str, "_models.OrderState"], comments: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword status: Status of the order as per the allowed status types. Required. Known values - are: "Untracked", "AwaitingFulfilment", "AwaitingPreparation", "AwaitingShipment", "Shipped", - "Arriving", "Delivered", "ReplacementRequested", "LostDevice", "Declined", "ReturnInitiated", - "AwaitingReturnShipment", "ShippedBack", and "CollectedAtMicrosoft". - :paramtype status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.OrderState - :keyword comments: Comments related to this status change. - :paramtype comments: str - """ - super().__init__(**kwargs) - self.status = status - self.update_date_time = None - self.comments = comments - self.additional_order_details = None - - -class PeriodicTimerEventTrigger(Trigger): - """Trigger details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar kind: Trigger Kind. Required. Known values are: "FileEvent" and "PeriodicTimerEvent". - :vartype kind: str or ~azure.mgmt.databoxedge.v2019_08_01.models.TriggerEventType - :ivar source_info: Periodic timer details. Required. - :vartype source_info: ~azure.mgmt.databoxedge.v2019_08_01.models.PeriodicTimerSourceInfo - :ivar sink_info: Role Sink information. Required. - :vartype sink_info: ~azure.mgmt.databoxedge.v2019_08_01.models.RoleSinkInfo - :ivar custom_context_tag: A custom context tag typically used to correlate the trigger against - its usage. For example, if a periodic timer trigger is intended for certain specific IoT - modules in the device, the tag can be the name or the image URL of the module. - :vartype custom_context_tag: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"required": True}, - "source_info": {"required": True}, - "sink_info": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "source_info": {"key": "properties.sourceInfo", "type": "PeriodicTimerSourceInfo"}, - "sink_info": {"key": "properties.sinkInfo", "type": "RoleSinkInfo"}, - "custom_context_tag": {"key": "properties.customContextTag", "type": "str"}, - } - - def __init__( - self, - *, - source_info: "_models.PeriodicTimerSourceInfo", - sink_info: "_models.RoleSinkInfo", - custom_context_tag: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword source_info: Periodic timer details. Required. - :paramtype source_info: ~azure.mgmt.databoxedge.v2019_08_01.models.PeriodicTimerSourceInfo - :keyword sink_info: Role Sink information. Required. - :paramtype sink_info: ~azure.mgmt.databoxedge.v2019_08_01.models.RoleSinkInfo - :keyword custom_context_tag: A custom context tag typically used to correlate the trigger - against its usage. For example, if a periodic timer trigger is intended for certain specific - IoT modules in the device, the tag can be the name or the image URL of the module. - :paramtype custom_context_tag: str - """ - super().__init__(**kwargs) - self.kind: str = "PeriodicTimerEvent" - self.source_info = source_info - self.sink_info = sink_info - self.custom_context_tag = custom_context_tag - - -class PeriodicTimerSourceInfo(_serialization.Model): - """Periodic timer event source. - - All required parameters must be populated in order to send to server. - - :ivar start_time: The time of the day that results in a valid trigger. Schedule is computed - with reference to the time specified upto seconds. If timezone is not specified the time will - considered to be in device timezone. The value will always be returned as UTC time. Required. - :vartype start_time: ~datetime.datetime - :ivar schedule: Periodic frequency at which timer event needs to be raised. Supports daily, - hourly, minutes, and seconds. Required. - :vartype schedule: str - :ivar topic: Topic where periodic events are published to IoT device. - :vartype topic: str - """ - - _validation = { - "start_time": {"required": True}, - "schedule": {"required": True}, - } - - _attribute_map = { - "start_time": {"key": "startTime", "type": "iso-8601"}, - "schedule": {"key": "schedule", "type": "str"}, - "topic": {"key": "topic", "type": "str"}, - } - - def __init__( - self, *, start_time: datetime.datetime, schedule: str, topic: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword start_time: The time of the day that results in a valid trigger. Schedule is computed - with reference to the time specified upto seconds. If timezone is not specified the time will - considered to be in device timezone. The value will always be returned as UTC time. Required. - :paramtype start_time: ~datetime.datetime - :keyword schedule: Periodic frequency at which timer event needs to be raised. Supports daily, - hourly, minutes, and seconds. Required. - :paramtype schedule: str - :keyword topic: Topic where periodic events are published to IoT device. - :paramtype topic: str - """ - super().__init__(**kwargs) - self.start_time = start_time - self.schedule = schedule - self.topic = topic - - -class RefreshDetails(_serialization.Model): - """Fields for tracking refresh job on the share or container. - - :ivar in_progress_refresh_job_id: If a refresh job is currently in progress on this share or - container, this field indicates the ARM resource ID of that job. The field is empty if no job - is in progress. - :vartype in_progress_refresh_job_id: str - :ivar last_completed_refresh_job_time_in_utc: Indicates the completed time for the last refresh - job on this particular share or container, if any.This could be a failed job or a successful - job. - :vartype last_completed_refresh_job_time_in_utc: ~datetime.datetime - :ivar error_manifest_file: Indicates the relative path of the error xml for the last refresh - job on this particular share or container, if any. This could be a failed job or a successful - job. - :vartype error_manifest_file: str - :ivar last_job: Indicates the id of the last refresh job on this particular share or - container,if any. This could be a failed job or a successful job. - :vartype last_job: str - """ - - _attribute_map = { - "in_progress_refresh_job_id": {"key": "inProgressRefreshJobId", "type": "str"}, - "last_completed_refresh_job_time_in_utc": {"key": "lastCompletedRefreshJobTimeInUTC", "type": "iso-8601"}, - "error_manifest_file": {"key": "errorManifestFile", "type": "str"}, - "last_job": {"key": "lastJob", "type": "str"}, - } - - def __init__( - self, - *, - in_progress_refresh_job_id: Optional[str] = None, - last_completed_refresh_job_time_in_utc: Optional[datetime.datetime] = None, - error_manifest_file: Optional[str] = None, - last_job: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword in_progress_refresh_job_id: If a refresh job is currently in progress on this share or - container, this field indicates the ARM resource ID of that job. The field is empty if no job - is in progress. - :paramtype in_progress_refresh_job_id: str - :keyword last_completed_refresh_job_time_in_utc: Indicates the completed time for the last - refresh job on this particular share or container, if any.This could be a failed job or a - successful job. - :paramtype last_completed_refresh_job_time_in_utc: ~datetime.datetime - :keyword error_manifest_file: Indicates the relative path of the error xml for the last refresh - job on this particular share or container, if any. This could be a failed job or a successful - job. - :paramtype error_manifest_file: str - :keyword last_job: Indicates the id of the last refresh job on this particular share or - container,if any. This could be a failed job or a successful job. - :paramtype last_job: str - """ - super().__init__(**kwargs) - self.in_progress_refresh_job_id = in_progress_refresh_job_id - self.last_completed_refresh_job_time_in_utc = last_completed_refresh_job_time_in_utc - self.error_manifest_file = error_manifest_file - self.last_job = last_job - - -class ResourceTypeSku(_serialization.Model): - """SkuInformation object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar resource_type: The type of the resource. - :vartype resource_type: str - :ivar name: The Sku name. Known values are: "Gateway", "Edge", "TEA_1Node", "TEA_1Node_UPS", - "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", "TEA_4Node_UPS_Heater", and - "TMA". - :vartype name: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuName - :ivar kind: The Sku kind. - :vartype kind: str - :ivar tier: The Sku tier. "Standard" - :vartype tier: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuTier - :ivar family: The Sku family. - :vartype family: str - :ivar locations: Availability of the SKU for the region. - :vartype locations: list[str] - :ivar api_versions: The API versions in which SKU is available. - :vartype api_versions: list[str] - :ivar location_info: Availability of the SKU for the location/zone. - :vartype location_info: list[~azure.mgmt.databoxedge.v2019_08_01.models.SkuLocationInfo] - :ivar costs: The pricing info of the Sku. - :vartype costs: list[~azure.mgmt.databoxedge.v2019_08_01.models.SkuCost] - :ivar restrictions: Restrictions of the SKU availability. - :vartype restrictions: list[~azure.mgmt.databoxedge.v2019_08_01.models.SkuRestriction] - """ - - _validation = { - "resource_type": {"readonly": True}, - "name": {"readonly": True}, - "kind": {"readonly": True}, - "tier": {"readonly": True}, - "family": {"readonly": True}, - "locations": {"readonly": True}, - "api_versions": {"readonly": True}, - "location_info": {"readonly": True}, - "costs": {"readonly": True}, - "restrictions": {"readonly": True}, - } - - _attribute_map = { - "resource_type": {"key": "resourceType", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "locations": {"key": "locations", "type": "[str]"}, - "api_versions": {"key": "apiVersions", "type": "[str]"}, - "location_info": {"key": "locationInfo", "type": "[SkuLocationInfo]"}, - "costs": {"key": "costs", "type": "[SkuCost]"}, - "restrictions": {"key": "restrictions", "type": "[SkuRestriction]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.resource_type = None - self.name = None - self.kind = None - self.tier = None - self.family = None - self.locations = None - self.api_versions = None - self.location_info = None - self.costs = None - self.restrictions = None - - -class RoleList(_serialization.Model): - """Collection of all the roles on the Data Box Edge device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The Value. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Role] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Role]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class RoleSinkInfo(_serialization.Model): - """Compute role against which events will be raised. - - All required parameters must be populated in order to send to server. - - :ivar role_id: Compute role ID. Required. - :vartype role_id: str - """ - - _validation = { - "role_id": {"required": True}, - } - - _attribute_map = { - "role_id": {"key": "roleId", "type": "str"}, - } - - def __init__(self, *, role_id: str, **kwargs: Any) -> None: - """ - :keyword role_id: Compute role ID. Required. - :paramtype role_id: str - """ - super().__init__(**kwargs) - self.role_id = role_id - - -class SecuritySettings(ARMBaseModel): - """The security settings of a device. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar device_admin_password: Device administrator password as an encrypted string (encrypted - using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password - should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and - special characters. Required. - :vartype device_admin_password: - ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "device_admin_password": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "device_admin_password": {"key": "properties.deviceAdminPassword", "type": "AsymmetricEncryptedSecret"}, - } - - def __init__(self, *, device_admin_password: "_models.AsymmetricEncryptedSecret", **kwargs: Any) -> None: - """ - :keyword device_admin_password: Device administrator password as an encrypted string (encrypted - using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password - should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and - special characters. Required. - :paramtype device_admin_password: - ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret - """ - super().__init__(**kwargs) - self.device_admin_password = device_admin_password - - -class ServiceSpecification(_serialization.Model): - """Service specification. - - :ivar metric_specifications: Metric specification as defined by shoebox. - :vartype metric_specifications: - list[~azure.mgmt.databoxedge.v2019_08_01.models.MetricSpecificationV1] - """ - - _attribute_map = { - "metric_specifications": {"key": "metricSpecifications", "type": "[MetricSpecificationV1]"}, - } - - def __init__( - self, *, metric_specifications: Optional[List["_models.MetricSpecificationV1"]] = None, **kwargs: Any - ) -> None: - """ - :keyword metric_specifications: Metric specification as defined by shoebox. - :paramtype metric_specifications: - list[~azure.mgmt.databoxedge.v2019_08_01.models.MetricSpecificationV1] - """ - super().__init__(**kwargs) - self.metric_specifications = metric_specifications - - -class Share(ARMBaseModel): - """Represents a share on the Data Box Edge/Gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar description: Description for the share. - :vartype description: str - :ivar share_status: Current status of the share. Required. Known values are: "Offline", - "Unknown", "OK", "Updating", and "NeedsAttention". - :vartype share_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareStatus - :ivar monitoring_status: Current monitoring status of the share. Required. Known values are: - "Enabled" and "Disabled". - :vartype monitoring_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.MonitoringStatus - :ivar azure_container_info: Azure container mapping for the share. - :vartype azure_container_info: ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerInfo - :ivar access_protocol: Access protocol to be used by the share. Required. Known values are: - "SMB" and "NFS". - :vartype access_protocol: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessProtocol - :ivar user_access_rights: Mapping of users and corresponding access rights on the share - (required for SMB protocol). - :vartype user_access_rights: list[~azure.mgmt.databoxedge.v2019_08_01.models.UserAccessRight] - :ivar client_access_rights: List of IP addresses and corresponding access rights on the - share(required for NFS protocol). - :vartype client_access_rights: - list[~azure.mgmt.databoxedge.v2019_08_01.models.ClientAccessRight] - :ivar refresh_details: Details of the refresh job on this share. - :vartype refresh_details: ~azure.mgmt.databoxedge.v2019_08_01.models.RefreshDetails - :ivar share_mappings: Share mount point to the role. - :vartype share_mappings: list[~azure.mgmt.databoxedge.v2019_08_01.models.MountPointMap] - :ivar data_policy: Data policy of the share. Known values are: "Cloud" and "Local". - :vartype data_policy: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DataPolicy - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "share_status": {"required": True}, - "monitoring_status": {"required": True}, - "access_protocol": {"required": True}, - "share_mappings": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "description": {"key": "properties.description", "type": "str"}, - "share_status": {"key": "properties.shareStatus", "type": "str"}, - "monitoring_status": {"key": "properties.monitoringStatus", "type": "str"}, - "azure_container_info": {"key": "properties.azureContainerInfo", "type": "AzureContainerInfo"}, - "access_protocol": {"key": "properties.accessProtocol", "type": "str"}, - "user_access_rights": {"key": "properties.userAccessRights", "type": "[UserAccessRight]"}, - "client_access_rights": {"key": "properties.clientAccessRights", "type": "[ClientAccessRight]"}, - "refresh_details": {"key": "properties.refreshDetails", "type": "RefreshDetails"}, - "share_mappings": {"key": "properties.shareMappings", "type": "[MountPointMap]"}, - "data_policy": {"key": "properties.dataPolicy", "type": "str"}, - } - - def __init__( - self, - *, - share_status: Union[str, "_models.ShareStatus"], - monitoring_status: Union[str, "_models.MonitoringStatus"], - access_protocol: Union[str, "_models.ShareAccessProtocol"], - description: Optional[str] = None, - azure_container_info: Optional["_models.AzureContainerInfo"] = None, - user_access_rights: Optional[List["_models.UserAccessRight"]] = None, - client_access_rights: Optional[List["_models.ClientAccessRight"]] = None, - refresh_details: Optional["_models.RefreshDetails"] = None, - data_policy: Optional[Union[str, "_models.DataPolicy"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword description: Description for the share. - :paramtype description: str - :keyword share_status: Current status of the share. Required. Known values are: "Offline", - "Unknown", "OK", "Updating", and "NeedsAttention". - :paramtype share_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareStatus - :keyword monitoring_status: Current monitoring status of the share. Required. Known values are: - "Enabled" and "Disabled". - :paramtype monitoring_status: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.MonitoringStatus - :keyword azure_container_info: Azure container mapping for the share. - :paramtype azure_container_info: ~azure.mgmt.databoxedge.v2019_08_01.models.AzureContainerInfo - :keyword access_protocol: Access protocol to be used by the share. Required. Known values are: - "SMB" and "NFS". - :paramtype access_protocol: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessProtocol - :keyword user_access_rights: Mapping of users and corresponding access rights on the share - (required for SMB protocol). - :paramtype user_access_rights: list[~azure.mgmt.databoxedge.v2019_08_01.models.UserAccessRight] - :keyword client_access_rights: List of IP addresses and corresponding access rights on the - share(required for NFS protocol). - :paramtype client_access_rights: - list[~azure.mgmt.databoxedge.v2019_08_01.models.ClientAccessRight] - :keyword refresh_details: Details of the refresh job on this share. - :paramtype refresh_details: ~azure.mgmt.databoxedge.v2019_08_01.models.RefreshDetails - :keyword data_policy: Data policy of the share. Known values are: "Cloud" and "Local". - :paramtype data_policy: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DataPolicy - """ - super().__init__(**kwargs) - self.description = description - self.share_status = share_status - self.monitoring_status = monitoring_status - self.azure_container_info = azure_container_info - self.access_protocol = access_protocol - self.user_access_rights = user_access_rights - self.client_access_rights = client_access_rights - self.refresh_details = refresh_details - self.share_mappings = None - self.data_policy = data_policy - - -class ShareAccessRight(_serialization.Model): - """Specifies the mapping between this particular user and the type of access he has on shares on - this device. - - All required parameters must be populated in order to send to server. - - :ivar share_id: The share ID. Required. - :vartype share_id: str - :ivar access_type: Type of access to be allowed on the share for this user. Required. Known - values are: "Change", "Read", and "Custom". - :vartype access_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessType - """ - - _validation = { - "share_id": {"required": True}, - "access_type": {"required": True}, - } - - _attribute_map = { - "share_id": {"key": "shareId", "type": "str"}, - "access_type": {"key": "accessType", "type": "str"}, - } - - def __init__(self, *, share_id: str, access_type: Union[str, "_models.ShareAccessType"], **kwargs: Any) -> None: - """ - :keyword share_id: The share ID. Required. - :paramtype share_id: str - :keyword access_type: Type of access to be allowed on the share for this user. Required. Known - values are: "Change", "Read", and "Custom". - :paramtype access_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessType - """ - super().__init__(**kwargs) - self.share_id = share_id - self.access_type = access_type - - -class ShareList(_serialization.Model): - """Collection of all the shares on the Data Box Edge/Gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of shares. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Share] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Share]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class Sku(_serialization.Model): - """The SKU type. - - :ivar name: SKU name. Known values are: "Gateway", "Edge", "TEA_1Node", "TEA_1Node_UPS", - "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", "TEA_4Node_UPS_Heater", and - "TMA". - :vartype name: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuName - :ivar tier: The SKU tier. This is based on the SKU name. "Standard" - :vartype tier: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuTier - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[Union[str, "_models.SkuName"]] = None, - tier: Optional[Union[str, "_models.SkuTier"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: SKU name. Known values are: "Gateway", "Edge", "TEA_1Node", "TEA_1Node_UPS", - "TEA_1Node_Heater", "TEA_1Node_UPS_Heater", "TEA_4Node_Heater", "TEA_4Node_UPS_Heater", and - "TMA". - :paramtype name: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuName - :keyword tier: The SKU tier. This is based on the SKU name. "Standard" - :paramtype tier: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SkuTier - """ - super().__init__(**kwargs) - self.name = name - self.tier = tier - - -class SkuCost(_serialization.Model): - """The metadata for retrieving price info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar meter_id: Used for querying price from commerce. - :vartype meter_id: str - :ivar quantity: The cost quantity. - :vartype quantity: int - :ivar extended_unit: Restriction of the SKU for the location/zone. - :vartype extended_unit: str - """ - - _validation = { - "meter_id": {"readonly": True}, - "quantity": {"readonly": True}, - "extended_unit": {"readonly": True}, - } - - _attribute_map = { - "meter_id": {"key": "meterId", "type": "str"}, - "quantity": {"key": "quantity", "type": "int"}, - "extended_unit": {"key": "extendedUnit", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.meter_id = None - self.quantity = None - self.extended_unit = None - - -class SkuInformationList(_serialization.Model): - """List of SKU Information objects. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of ResourceType Sku. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.ResourceTypeSku] - :ivar next_link: Links to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ResourceTypeSku]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class SkuLocationInfo(_serialization.Model): - """The location info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: The location. - :vartype location: str - :ivar zones: The zones. - :vartype zones: list[str] - :ivar sites: The sites. - :vartype sites: list[str] - """ - - _validation = { - "location": {"readonly": True}, - "zones": {"readonly": True}, - "sites": {"readonly": True}, - } - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "zones": {"key": "zones", "type": "[str]"}, - "sites": {"key": "sites", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.location = None - self.zones = None - self.sites = None - - -class SkuRestriction(_serialization.Model): - """The restrictions because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The type of the restriction. - :vartype type: str - :ivar values: The locations where sku is restricted. - :vartype values: list[str] - :ivar reason_code: The SKU restriction reason. Known values are: "NotAvailableForSubscription" - and "QuotaId". - :vartype reason_code: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.SkuRestrictionReasonCode - :ivar restriction_info: Restriction of the SKU for the location/zone. - :vartype restriction_info: ~azure.mgmt.databoxedge.v2019_08_01.models.SkuRestrictionInfo - """ - - _validation = { - "type": {"readonly": True}, - "values": {"readonly": True}, - "reason_code": {"readonly": True}, - "restriction_info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "values": {"key": "values", "type": "[str]"}, - "reason_code": {"key": "reasonCode", "type": "str"}, - "restriction_info": {"key": "restrictionInfo", "type": "SkuRestrictionInfo"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = None - self.restriction_info = None - - -class SkuRestrictionInfo(_serialization.Model): - """The restriction info with locations and zones. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar locations: The locations. - :vartype locations: list[str] - :ivar zones: The zones. - :vartype zones: list[str] - """ - - _validation = { - "locations": {"readonly": True}, - "zones": {"readonly": True}, - } - - _attribute_map = { - "locations": {"key": "locations", "type": "[str]"}, - "zones": {"key": "zones", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.locations = None - self.zones = None - - -class StorageAccount(ARMBaseModel): - """Represents a Storage Account on the Data Box Edge/Gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar description: Description for the storage Account. - :vartype description: str - :ivar storage_account_status: Current status of the storage account. Known values are: "OK", - "Offline", "Unknown", "Updating", and "NeedsAttention". - :vartype storage_account_status: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountStatus - :ivar data_policy: Data policy of the storage Account. Known values are: "Cloud" and "Local". - :vartype data_policy: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DataPolicy - :ivar storage_account_credential_id: Storage Account Credential Id. - :vartype storage_account_credential_id: str - :ivar blob_endpoint: BlobEndpoint of Storage Account. - :vartype blob_endpoint: str - :ivar container_count: The Container Count. Present only for Storage Accounts with DataPolicy - set to Cloud. - :vartype container_count: int - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "blob_endpoint": {"readonly": True}, - "container_count": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "description": {"key": "properties.description", "type": "str"}, - "storage_account_status": {"key": "properties.storageAccountStatus", "type": "str"}, - "data_policy": {"key": "properties.dataPolicy", "type": "str"}, - "storage_account_credential_id": {"key": "properties.storageAccountCredentialId", "type": "str"}, - "blob_endpoint": {"key": "properties.blobEndpoint", "type": "str"}, - "container_count": {"key": "properties.containerCount", "type": "int"}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - storage_account_status: Optional[Union[str, "_models.StorageAccountStatus"]] = None, - data_policy: Optional[Union[str, "_models.DataPolicy"]] = None, - storage_account_credential_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword description: Description for the storage Account. - :paramtype description: str - :keyword storage_account_status: Current status of the storage account. Known values are: "OK", - "Offline", "Unknown", "Updating", and "NeedsAttention". - :paramtype storage_account_status: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountStatus - :keyword data_policy: Data policy of the storage Account. Known values are: "Cloud" and - "Local". - :paramtype data_policy: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DataPolicy - :keyword storage_account_credential_id: Storage Account Credential Id. - :paramtype storage_account_credential_id: str - """ - super().__init__(**kwargs) - self.description = description - self.storage_account_status = storage_account_status - self.data_policy = data_policy - self.storage_account_credential_id = storage_account_credential_id - self.blob_endpoint = None - self.container_count = None - - -class StorageAccountCredential(ARMBaseModel): - """The storage account credential. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar alias: Alias for the storage account. Required. - :vartype alias: str - :ivar user_name: Username for the storage account. - :vartype user_name: str - :ivar account_key: Encrypted storage key. - :vartype account_key: ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret - :ivar connection_string: Connection string for the storage account. Use this string if username - and account key are not specified. - :vartype connection_string: str - :ivar ssl_status: Signifies whether SSL needs to be enabled or not. Required. Known values are: - "Enabled" and "Disabled". - :vartype ssl_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SSLStatus - :ivar blob_domain_name: Blob end point for private clouds. - :vartype blob_domain_name: str - :ivar account_type: Type of storage accessed on the storage account. Required. Known values - are: "GeneralPurposeStorage" and "BlobStorage". - :vartype account_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AccountType - :ivar storage_account_id: Id of the storage account. - :vartype storage_account_id: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "alias": {"required": True}, - "ssl_status": {"required": True}, - "account_type": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "alias": {"key": "properties.alias", "type": "str"}, - "user_name": {"key": "properties.userName", "type": "str"}, - "account_key": {"key": "properties.accountKey", "type": "AsymmetricEncryptedSecret"}, - "connection_string": {"key": "properties.connectionString", "type": "str"}, - "ssl_status": {"key": "properties.sslStatus", "type": "str"}, - "blob_domain_name": {"key": "properties.blobDomainName", "type": "str"}, - "account_type": {"key": "properties.accountType", "type": "str"}, - "storage_account_id": {"key": "properties.storageAccountId", "type": "str"}, - } - - def __init__( - self, - *, - alias: str, - ssl_status: Union[str, "_models.SSLStatus"], - account_type: Union[str, "_models.AccountType"], - user_name: Optional[str] = None, - account_key: Optional["_models.AsymmetricEncryptedSecret"] = None, - connection_string: Optional[str] = None, - blob_domain_name: Optional[str] = None, - storage_account_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword alias: Alias for the storage account. Required. - :paramtype alias: str - :keyword user_name: Username for the storage account. - :paramtype user_name: str - :keyword account_key: Encrypted storage key. - :paramtype account_key: ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret - :keyword connection_string: Connection string for the storage account. Use this string if - username and account key are not specified. - :paramtype connection_string: str - :keyword ssl_status: Signifies whether SSL needs to be enabled or not. Required. Known values - are: "Enabled" and "Disabled". - :paramtype ssl_status: str or ~azure.mgmt.databoxedge.v2019_08_01.models.SSLStatus - :keyword blob_domain_name: Blob end point for private clouds. - :paramtype blob_domain_name: str - :keyword account_type: Type of storage accessed on the storage account. Required. Known values - are: "GeneralPurposeStorage" and "BlobStorage". - :paramtype account_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AccountType - :keyword storage_account_id: Id of the storage account. - :paramtype storage_account_id: str - """ - super().__init__(**kwargs) - self.alias = alias - self.user_name = user_name - self.account_key = account_key - self.connection_string = connection_string - self.ssl_status = ssl_status - self.blob_domain_name = blob_domain_name - self.account_type = account_type - self.storage_account_id = storage_account_id - - -class StorageAccountCredentialList(_serialization.Model): - """The collection of storage account credentials. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The value. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccountCredential] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[StorageAccountCredential]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class StorageAccountList(_serialization.Model): - """Collection of all the Storage Accounts on the Data Box Edge/Gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of storageAccounts. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.StorageAccount] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[StorageAccount]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class SymmetricKey(_serialization.Model): - """Symmetric key for authentication. - - :ivar connection_string: Connection string based on the symmetric key. - :vartype connection_string: - ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret - """ - - _attribute_map = { - "connection_string": {"key": "connectionString", "type": "AsymmetricEncryptedSecret"}, - } - - def __init__( - self, *, connection_string: Optional["_models.AsymmetricEncryptedSecret"] = None, **kwargs: Any - ) -> None: - """ - :keyword connection_string: Connection string based on the symmetric key. - :paramtype connection_string: - ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret - """ - super().__init__(**kwargs) - self.connection_string = connection_string - - -class TrackingInfo(_serialization.Model): - """Tracking courier information. - - :ivar serial_number: Serial number of the device being tracked. - :vartype serial_number: str - :ivar carrier_name: Name of the carrier used in the delivery. - :vartype carrier_name: str - :ivar tracking_id: Tracking ID of the shipment. - :vartype tracking_id: str - :ivar tracking_url: Tracking URL of the shipment. - :vartype tracking_url: str - """ - - _attribute_map = { - "serial_number": {"key": "serialNumber", "type": "str"}, - "carrier_name": {"key": "carrierName", "type": "str"}, - "tracking_id": {"key": "trackingId", "type": "str"}, - "tracking_url": {"key": "trackingUrl", "type": "str"}, - } - - def __init__( - self, - *, - serial_number: Optional[str] = None, - carrier_name: Optional[str] = None, - tracking_id: Optional[str] = None, - tracking_url: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword serial_number: Serial number of the device being tracked. - :paramtype serial_number: str - :keyword carrier_name: Name of the carrier used in the delivery. - :paramtype carrier_name: str - :keyword tracking_id: Tracking ID of the shipment. - :paramtype tracking_id: str - :keyword tracking_url: Tracking URL of the shipment. - :paramtype tracking_url: str - """ - super().__init__(**kwargs) - self.serial_number = serial_number - self.carrier_name = carrier_name - self.tracking_id = tracking_id - self.tracking_url = tracking_url - - -class TriggerList(_serialization.Model): - """Collection of all trigger on the data box edge device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of triggers. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.Trigger] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Trigger]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class UpdateDownloadProgress(_serialization.Model): - """Details about the download progress of update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar download_phase: The download phase. Known values are: "Unknown", "Initializing", - "Downloading", and "Verifying". - :vartype download_phase: str or ~azure.mgmt.databoxedge.v2019_08_01.models.DownloadPhase - :ivar percent_complete: Percentage of completion. - :vartype percent_complete: int - :ivar total_bytes_to_download: Total bytes to download. - :vartype total_bytes_to_download: float - :ivar total_bytes_downloaded: Total bytes downloaded. - :vartype total_bytes_downloaded: float - :ivar number_of_updates_to_download: Number of updates to download. - :vartype number_of_updates_to_download: int - :ivar number_of_updates_downloaded: Number of updates downloaded. - :vartype number_of_updates_downloaded: int - """ - - _validation = { - "download_phase": {"readonly": True}, - "percent_complete": {"readonly": True}, - "total_bytes_to_download": {"readonly": True}, - "total_bytes_downloaded": {"readonly": True}, - "number_of_updates_to_download": {"readonly": True}, - "number_of_updates_downloaded": {"readonly": True}, - } - - _attribute_map = { - "download_phase": {"key": "downloadPhase", "type": "str"}, - "percent_complete": {"key": "percentComplete", "type": "int"}, - "total_bytes_to_download": {"key": "totalBytesToDownload", "type": "float"}, - "total_bytes_downloaded": {"key": "totalBytesDownloaded", "type": "float"}, - "number_of_updates_to_download": {"key": "numberOfUpdatesToDownload", "type": "int"}, - "number_of_updates_downloaded": {"key": "numberOfUpdatesDownloaded", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.download_phase = None - self.percent_complete = None - self.total_bytes_to_download = None - self.total_bytes_downloaded = None - self.number_of_updates_to_download = None - self.number_of_updates_downloaded = None - - -class UpdateInstallProgress(_serialization.Model): - """Progress details during installation of updates. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar percent_complete: Percentage completed. - :vartype percent_complete: int - :ivar number_of_updates_to_install: Number of updates to install. - :vartype number_of_updates_to_install: int - :ivar number_of_updates_installed: Number of updates installed. - :vartype number_of_updates_installed: int - """ - - _validation = { - "percent_complete": {"readonly": True}, - "number_of_updates_to_install": {"readonly": True}, - "number_of_updates_installed": {"readonly": True}, - } - - _attribute_map = { - "percent_complete": {"key": "percentComplete", "type": "int"}, - "number_of_updates_to_install": {"key": "numberOfUpdatesToInstall", "type": "int"}, - "number_of_updates_installed": {"key": "numberOfUpdatesInstalled", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.percent_complete = None - self.number_of_updates_to_install = None - self.number_of_updates_installed = None - - -class UpdateSummary(ARMBaseModel): - """Details about ongoing updates and availability of updates on the device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar device_version_number: The current version of the device in format: 1.2.17312.13.",. - :vartype device_version_number: str - :ivar friendly_device_version_name: The current version of the device in text format. - :vartype friendly_device_version_name: str - :ivar device_last_scanned_date_time: The last time when a scan was done on the device. - :vartype device_last_scanned_date_time: ~datetime.datetime - :ivar last_completed_scan_job_date_time: The time when the last scan job was completed - (success/cancelled/failed) on the appliance. - :vartype last_completed_scan_job_date_time: ~datetime.datetime - :ivar last_completed_download_job_date_time: The time when the last Download job was completed - (success/cancelled/failed) on the appliance. - :vartype last_completed_download_job_date_time: ~datetime.datetime - :ivar last_completed_install_job_date_time: The time when the last Install job was completed - (success/cancelled/failed) on the appliance. - :vartype last_completed_install_job_date_time: ~datetime.datetime - :ivar total_number_of_updates_available: The number of updates available for the current device - version as per the last device scan. - :vartype total_number_of_updates_available: int - :ivar total_number_of_updates_pending_download: The total number of items pending download. - :vartype total_number_of_updates_pending_download: int - :ivar total_number_of_updates_pending_install: The total number of items pending install. - :vartype total_number_of_updates_pending_install: int - :ivar reboot_behavior: Indicates if updates are available and at least one of the updates needs - a reboot. Known values are: "NeverReboots", "RequiresReboot", and "RequestReboot". - :vartype reboot_behavior: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.InstallRebootBehavior - :ivar ongoing_update_operation: The current update operation. Known values are: "None", "Scan", - "Download", and "Install". - :vartype ongoing_update_operation: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateOperation - :ivar in_progress_download_job_id: The job ID of the download job in progress. - :vartype in_progress_download_job_id: str - :ivar in_progress_install_job_id: The job ID of the install job in progress. - :vartype in_progress_install_job_id: str - :ivar in_progress_download_job_started_date_time: The time when the currently running download - (if any) started. - :vartype in_progress_download_job_started_date_time: ~datetime.datetime - :ivar in_progress_install_job_started_date_time: The time when the currently running install - (if any) started. - :vartype in_progress_install_job_started_date_time: ~datetime.datetime - :ivar update_titles: The list of updates available for install. - :vartype update_titles: list[str] - :ivar total_update_size_in_bytes: The total size of updates available for download in bytes. - :vartype total_update_size_in_bytes: float - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "last_completed_download_job_date_time": {"readonly": True}, - "last_completed_install_job_date_time": {"readonly": True}, - "total_number_of_updates_available": {"readonly": True}, - "total_number_of_updates_pending_download": {"readonly": True}, - "total_number_of_updates_pending_install": {"readonly": True}, - "reboot_behavior": {"readonly": True}, - "ongoing_update_operation": {"readonly": True}, - "in_progress_download_job_id": {"readonly": True}, - "in_progress_install_job_id": {"readonly": True}, - "in_progress_download_job_started_date_time": {"readonly": True}, - "in_progress_install_job_started_date_time": {"readonly": True}, - "update_titles": {"readonly": True}, - "total_update_size_in_bytes": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "device_version_number": {"key": "properties.deviceVersionNumber", "type": "str"}, - "friendly_device_version_name": {"key": "properties.friendlyDeviceVersionName", "type": "str"}, - "device_last_scanned_date_time": {"key": "properties.deviceLastScannedDateTime", "type": "iso-8601"}, - "last_completed_scan_job_date_time": {"key": "properties.lastCompletedScanJobDateTime", "type": "iso-8601"}, - "last_completed_download_job_date_time": { - "key": "properties.lastCompletedDownloadJobDateTime", - "type": "iso-8601", - }, - "last_completed_install_job_date_time": { - "key": "properties.lastCompletedInstallJobDateTime", - "type": "iso-8601", - }, - "total_number_of_updates_available": {"key": "properties.totalNumberOfUpdatesAvailable", "type": "int"}, - "total_number_of_updates_pending_download": { - "key": "properties.totalNumberOfUpdatesPendingDownload", - "type": "int", - }, - "total_number_of_updates_pending_install": { - "key": "properties.totalNumberOfUpdatesPendingInstall", - "type": "int", - }, - "reboot_behavior": {"key": "properties.rebootBehavior", "type": "str"}, - "ongoing_update_operation": {"key": "properties.ongoingUpdateOperation", "type": "str"}, - "in_progress_download_job_id": {"key": "properties.inProgressDownloadJobId", "type": "str"}, - "in_progress_install_job_id": {"key": "properties.inProgressInstallJobId", "type": "str"}, - "in_progress_download_job_started_date_time": { - "key": "properties.inProgressDownloadJobStartedDateTime", - "type": "iso-8601", - }, - "in_progress_install_job_started_date_time": { - "key": "properties.inProgressInstallJobStartedDateTime", - "type": "iso-8601", - }, - "update_titles": {"key": "properties.updateTitles", "type": "[str]"}, - "total_update_size_in_bytes": {"key": "properties.totalUpdateSizeInBytes", "type": "float"}, - } - - def __init__( - self, - *, - device_version_number: Optional[str] = None, - friendly_device_version_name: Optional[str] = None, - device_last_scanned_date_time: Optional[datetime.datetime] = None, - last_completed_scan_job_date_time: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword device_version_number: The current version of the device in format: 1.2.17312.13.",. - :paramtype device_version_number: str - :keyword friendly_device_version_name: The current version of the device in text format. - :paramtype friendly_device_version_name: str - :keyword device_last_scanned_date_time: The last time when a scan was done on the device. - :paramtype device_last_scanned_date_time: ~datetime.datetime - :keyword last_completed_scan_job_date_time: The time when the last scan job was completed - (success/cancelled/failed) on the appliance. - :paramtype last_completed_scan_job_date_time: ~datetime.datetime - """ - super().__init__(**kwargs) - self.device_version_number = device_version_number - self.friendly_device_version_name = friendly_device_version_name - self.device_last_scanned_date_time = device_last_scanned_date_time - self.last_completed_scan_job_date_time = last_completed_scan_job_date_time - self.last_completed_download_job_date_time = None - self.last_completed_install_job_date_time = None - self.total_number_of_updates_available = None - self.total_number_of_updates_pending_download = None - self.total_number_of_updates_pending_install = None - self.reboot_behavior = None - self.ongoing_update_operation = None - self.in_progress_download_job_id = None - self.in_progress_install_job_id = None - self.in_progress_download_job_started_date_time = None - self.in_progress_install_job_started_date_time = None - self.update_titles = None - self.total_update_size_in_bytes = None - - -class UploadCertificateRequest(_serialization.Model): - """The upload certificate request. - - All required parameters must be populated in order to send to server. - - :ivar authentication_type: The authentication type. Known values are: "Invalid" and - "AzureActiveDirectory". - :vartype authentication_type: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.AuthenticationType - :ivar certificate: The base64 encoded certificate raw data. Required. - :vartype certificate: str - """ - - _validation = { - "certificate": {"required": True}, - } - - _attribute_map = { - "authentication_type": {"key": "properties.authenticationType", "type": "str"}, - "certificate": {"key": "properties.certificate", "type": "str"}, - } - - def __init__( - self, - *, - certificate: str, - authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword authentication_type: The authentication type. Known values are: "Invalid" and - "AzureActiveDirectory". - :paramtype authentication_type: str or - ~azure.mgmt.databoxedge.v2019_08_01.models.AuthenticationType - :keyword certificate: The base64 encoded certificate raw data. Required. - :paramtype certificate: str - """ - super().__init__(**kwargs) - self.authentication_type = authentication_type - self.certificate = certificate - - -class UploadCertificateResponse(_serialization.Model): - """The upload registration certificate response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar auth_type: Specifies authentication type. Known values are: "Invalid" and - "AzureActiveDirectory". - :vartype auth_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AuthenticationType - :ivar resource_id: The resource ID of the Data Box Edge/Gateway device. - :vartype resource_id: str - :ivar aad_authority: Azure Active Directory tenant authority. - :vartype aad_authority: str - :ivar aad_tenant_id: Azure Active Directory tenant ID. - :vartype aad_tenant_id: str - :ivar service_principal_client_id: Azure Active Directory service principal client ID. - :vartype service_principal_client_id: str - :ivar service_principal_object_id: Azure Active Directory service principal object ID. - :vartype service_principal_object_id: str - :ivar azure_management_endpoint_audience: The azure management endpoint audience. - :vartype azure_management_endpoint_audience: str - :ivar aad_audience: Identifier of the target resource that is the recipient of the requested - token. - :vartype aad_audience: str - """ - - _validation = { - "resource_id": {"readonly": True}, - "aad_authority": {"readonly": True}, - "aad_tenant_id": {"readonly": True}, - "service_principal_client_id": {"readonly": True}, - "service_principal_object_id": {"readonly": True}, - "azure_management_endpoint_audience": {"readonly": True}, - "aad_audience": {"readonly": True}, - } - - _attribute_map = { - "auth_type": {"key": "authType", "type": "str"}, - "resource_id": {"key": "resourceId", "type": "str"}, - "aad_authority": {"key": "aadAuthority", "type": "str"}, - "aad_tenant_id": {"key": "aadTenantId", "type": "str"}, - "service_principal_client_id": {"key": "servicePrincipalClientId", "type": "str"}, - "service_principal_object_id": {"key": "servicePrincipalObjectId", "type": "str"}, - "azure_management_endpoint_audience": {"key": "azureManagementEndpointAudience", "type": "str"}, - "aad_audience": {"key": "aadAudience", "type": "str"}, - } - - def __init__(self, *, auth_type: Optional[Union[str, "_models.AuthenticationType"]] = None, **kwargs: Any) -> None: - """ - :keyword auth_type: Specifies authentication type. Known values are: "Invalid" and - "AzureActiveDirectory". - :paramtype auth_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.AuthenticationType - """ - super().__init__(**kwargs) - self.auth_type = auth_type - self.resource_id = None - self.aad_authority = None - self.aad_tenant_id = None - self.service_principal_client_id = None - self.service_principal_object_id = None - self.azure_management_endpoint_audience = None - self.aad_audience = None - - -class User(ARMBaseModel): - """Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The path ID that uniquely identifies the object. - :vartype id: str - :ivar name: The object name. - :vartype name: str - :ivar type: The hierarchical type of the object. - :vartype type: str - :ivar encrypted_password: The password details. - :vartype encrypted_password: - ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret - :ivar share_access_rights: List of shares that the user has rights on. This field should not be - specified during user creation. - :vartype share_access_rights: list[~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessRight] - :ivar user_type: Type of the user. Required. Known values are: "Share", "LocalManagement", and - "ARM". - :vartype user_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.UserType - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "user_type": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "encrypted_password": {"key": "properties.encryptedPassword", "type": "AsymmetricEncryptedSecret"}, - "share_access_rights": {"key": "properties.shareAccessRights", "type": "[ShareAccessRight]"}, - "user_type": {"key": "properties.userType", "type": "str"}, - } - - def __init__( - self, - *, - user_type: Union[str, "_models.UserType"], - encrypted_password: Optional["_models.AsymmetricEncryptedSecret"] = None, - share_access_rights: Optional[List["_models.ShareAccessRight"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword encrypted_password: The password details. - :paramtype encrypted_password: - ~azure.mgmt.databoxedge.v2019_08_01.models.AsymmetricEncryptedSecret - :keyword share_access_rights: List of shares that the user has rights on. This field should not - be specified during user creation. - :paramtype share_access_rights: - list[~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessRight] - :keyword user_type: Type of the user. Required. Known values are: "Share", "LocalManagement", - and "ARM". - :paramtype user_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.UserType - """ - super().__init__(**kwargs) - self.encrypted_password = encrypted_password - self.share_access_rights = share_access_rights - self.user_type = user_type - - -class UserAccessRight(_serialization.Model): - """The mapping between a particular user and the access type on the SMB share. - - All required parameters must be populated in order to send to server. - - :ivar user_id: User ID (already existing in the device). Required. - :vartype user_id: str - :ivar access_type: Type of access to be allowed for the user. Required. Known values are: - "Change", "Read", and "Custom". - :vartype access_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessType - """ - - _validation = { - "user_id": {"required": True}, - "access_type": {"required": True}, - } - - _attribute_map = { - "user_id": {"key": "userId", "type": "str"}, - "access_type": {"key": "accessType", "type": "str"}, - } - - def __init__(self, *, user_id: str, access_type: Union[str, "_models.ShareAccessType"], **kwargs: Any) -> None: - """ - :keyword user_id: User ID (already existing in the device). Required. - :paramtype user_id: str - :keyword access_type: Type of access to be allowed for the user. Required. Known values are: - "Change", "Read", and "Custom". - :paramtype access_type: str or ~azure.mgmt.databoxedge.v2019_08_01.models.ShareAccessType - """ - super().__init__(**kwargs) - self.user_id = user_id - self.access_type = access_type - - -class UserList(_serialization.Model): - """Collection of users. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of users. - :vartype value: list[~azure.mgmt.databoxedge.v2019_08_01.models.User] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[User]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/__init__.py deleted file mode 100644 index d7e775aadef6..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/__init__.py +++ /dev/null @@ -1,55 +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. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import Operations # type: ignore -from ._devices_operations import DevicesOperations # type: ignore -from ._alerts_operations import AlertsOperations # type: ignore -from ._bandwidth_schedules_operations import BandwidthSchedulesOperations # type: ignore -from ._jobs_operations import JobsOperations # type: ignore -from ._nodes_operations import NodesOperations # type: ignore -from ._operations_status_operations import OperationsStatusOperations # type: ignore -from ._orders_operations import OrdersOperations # type: ignore -from ._roles_operations import RolesOperations # type: ignore -from ._shares_operations import SharesOperations # type: ignore -from ._storage_account_credentials_operations import StorageAccountCredentialsOperations # type: ignore -from ._storage_accounts_operations import StorageAccountsOperations # type: ignore -from ._containers_operations import ContainersOperations # type: ignore -from ._triggers_operations import TriggersOperations # type: ignore -from ._users_operations import UsersOperations # type: ignore -from ._skus_operations import SkusOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "Operations", - "DevicesOperations", - "AlertsOperations", - "BandwidthSchedulesOperations", - "JobsOperations", - "NodesOperations", - "OperationsStatusOperations", - "OrdersOperations", - "RolesOperations", - "SharesOperations", - "StorageAccountCredentialsOperations", - "StorageAccountsOperations", - "ContainersOperations", - "TriggersOperations", - "UsersOperations", - "SkusOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_devices_operations.py deleted file mode 100644 index 54a0833da676..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_devices_operations.py +++ /dev/null @@ -1,1938 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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, *, expand: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # 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, *, expand: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if 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_get_request(device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_download_updates_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_extended_information_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_install_updates_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_network_settings_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_scan_for_updates_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_security_settings_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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_get_update_summary_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_upload_certificate_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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 DevicesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s - :attr:`devices` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_subscription( - self, expand: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.DataBoxEdgeDevice"]: - """Gets all the Data Box Edge/Data Box Gateway devices in a subscription. - - :param expand: Specify $expand=details to populate additional fields related to the resource or - Specify $skipToken=\\ :code:`` to populate the next page in the list. Default value is - None. - :type expand: str - :return: An iterator like instance of either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.DataBoxEdgeDeviceList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataBoxEdgeDeviceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.DataBoxEdgeDevice"]: - """Gets all the Data Box Edge/Data Box Gateway devices in a resource group. - - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param expand: Specify $expand=details to populate additional fields related to the resource or - Specify $skipToken=\\ :code:`` to populate the next page in the list. Default value is - None. - :type expand: str - :return: An iterator like instance of either DataBoxEdgeDevice or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.DataBoxEdgeDeviceList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataBoxEdgeDeviceList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, device_name: str, resource_group_name: str, **kwargs: Any) -> _models.DataBoxEdgeDevice: - """Gets the properties of the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.DataBoxEdgeDevice] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataBoxEdgeDevice", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - device_name: str, - resource_group_name: str, - data_box_edge_device: Union[_models.DataBoxEdgeDevice, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(data_box_edge_device, (IOBase, bytes)): - _content = data_box_edge_device - else: - _json = self._serialize.body(data_box_edge_device, "DataBoxEdgeDevice") - - _request = build_create_or_update_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - data_box_edge_device: _models.DataBoxEdgeDevice, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataBoxEdgeDevice]: - """Creates or updates a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param data_box_edge_device: The resource object. Required. - :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either DataBoxEdgeDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - data_box_edge_device: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataBoxEdgeDevice]: - """Creates or updates a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param data_box_edge_device: The resource object. Required. - :type data_box_edge_device: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either DataBoxEdgeDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - data_box_edge_device: Union[_models.DataBoxEdgeDevice, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DataBoxEdgeDevice]: - """Creates or updates a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param data_box_edge_device: The resource object. Is either a DataBoxEdgeDevice type or a - IO[bytes] type. Required. - :type data_box_edge_device: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice or - IO[bytes] - :return: An instance of LROPoller that returns either DataBoxEdgeDevice or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataBoxEdgeDevice] = 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_or_update_initial( - device_name=device_name, - resource_group_name=resource_group_name, - data_box_edge_device=data_box_edge_device, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DataBoxEdgeDevice", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DataBoxEdgeDevice].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DataBoxEdgeDevice]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, device_name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, device_name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - def update( - self, - device_name: str, - resource_group_name: str, - parameters: _models.DataBoxEdgeDevicePatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataBoxEdgeDevice: - """Modifies a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The resource parameters. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevicePatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - device_name: str, - resource_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataBoxEdgeDevice: - """Modifies a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The resource parameters. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - device_name: str, - resource_group_name: str, - parameters: Union[_models.DataBoxEdgeDevicePatch, IO[bytes]], - **kwargs: Any - ) -> _models.DataBoxEdgeDevice: - """Modifies a Data Box Edge/Data Box Gateway resource. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The resource parameters. Is either a DataBoxEdgeDevicePatch type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevicePatch or - IO[bytes] - :return: DataBoxEdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataBoxEdgeDevice] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DataBoxEdgeDevicePatch") - - _request = build_update_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataBoxEdgeDevice", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _download_updates_initial(self, device_name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_download_updates_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_download_updates(self, device_name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Downloads the updates on a Data Box Edge/Data Box Gateway device. - - Downloads the updates on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._download_updates_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get_extended_information( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.DataBoxEdgeDeviceExtendedInfo: - """Gets additional information for the specified Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: DataBoxEdgeDeviceExtendedInfo or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.DataBoxEdgeDeviceExtendedInfo - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.DataBoxEdgeDeviceExtendedInfo] = kwargs.pop("cls", None) - - _request = build_get_extended_information_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataBoxEdgeDeviceExtendedInfo", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _install_updates_initial(self, device_name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_install_updates_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_install_updates(self, device_name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Installs the updates on the Data Box Edge/Data Box Gateway device. - - Installs the updates on the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._install_updates_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get_network_settings( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.NetworkSettings: - """Gets the network settings of the specified Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: NetworkSettings or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.NetworkSettings - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.NetworkSettings] = kwargs.pop("cls", None) - - _request = build_get_network_settings_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkSettings", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _scan_for_updates_initial(self, device_name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_scan_for_updates_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_scan_for_updates(self, device_name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Scans for updates on a Data Box Edge/Data Box Gateway device. - - Scans for updates on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._scan_for_updates_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _create_or_update_security_settings_initial( # pylint: disable=name-too-long - self, - device_name: str, - resource_group_name: str, - security_settings: Union[_models.SecuritySettings, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(security_settings, (IOBase, bytes)): - _content = security_settings - else: - _json = self._serialize.body(security_settings, "SecuritySettings") - - _request = build_create_or_update_security_settings_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update_security_settings( - self, - device_name: str, - resource_group_name: str, - security_settings: _models.SecuritySettings, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Updates the security settings on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param security_settings: The security settings. Required. - :type security_settings: ~azure.mgmt.databoxedge.v2019_08_01.models.SecuritySettings - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_security_settings( - self, - device_name: str, - resource_group_name: str, - security_settings: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Updates the security settings on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param security_settings: The security settings. Required. - :type security_settings: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update_security_settings( - self, - device_name: str, - resource_group_name: str, - security_settings: Union[_models.SecuritySettings, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Updates the security settings on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param security_settings: The security settings. Is either a SecuritySettings type or a - IO[bytes] type. Required. - :type security_settings: ~azure.mgmt.databoxedge.v2019_08_01.models.SecuritySettings 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: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_security_settings_initial( - device_name=device_name, - resource_group_name=resource_group_name, - security_settings=security_settings, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get_update_summary(self, device_name: str, resource_group_name: str, **kwargs: Any) -> _models.UpdateSummary: - """Gets information about the availability of updates based on the last scan of the device. It - also gets information about any ongoing download or install jobs on the device. - - Gets information about the availability of updates based on the last scan of the device. It - also gets information about any ongoing download or install jobs on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: UpdateSummary or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UpdateSummary - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.UpdateSummary] = kwargs.pop("cls", None) - - _request = build_get_update_summary_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateSummary", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def upload_certificate( - self, - device_name: str, - resource_group_name: str, - parameters: _models.UploadCertificateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UploadCertificateResponse: - """Uploads registration certificate for the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The upload certificate request. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def upload_certificate( - self, - device_name: str, - resource_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UploadCertificateResponse: - """Uploads registration certificate for the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The upload certificate request. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def upload_certificate( - self, - device_name: str, - resource_group_name: str, - parameters: Union[_models.UploadCertificateRequest, IO[bytes]], - **kwargs: Any - ) -> _models.UploadCertificateResponse: - """Uploads registration certificate for the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The upload certificate request. Is either a UploadCertificateRequest type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateRequest or - IO[bytes] - :return: UploadCertificateResponse or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.UploadCertificateResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UploadCertificateResponse] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "UploadCertificateRequest") - - _request = build_upload_certificate_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UploadCertificateResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_nodes_operations.py deleted file mode 100644 index a9e6ab339ae0..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_nodes_operations.py +++ /dev/null @@ -1,172 +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, 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.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class NodesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s - :attr:`nodes` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Node"]: - """Gets all the nodes currently configured under this Data Box Edge device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Node or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Node] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.NodeList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NodeList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_orders_operations.py deleted file mode 100644 index d8de1edfe117..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_orders_operations.py +++ /dev/null @@ -1,615 +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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", 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.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Order"]: - """Lists all the orders related to a Data Box Edge/Data Box Gateway device. - - Lists all the orders related to a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Order or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.Order] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.OrderList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OrderList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, device_name: str, resource_group_name: str, **kwargs: Any) -> _models.Order: - """Gets a specific order by name. - - Gets a specific order by name. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Order or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2019_08_01.models.Order - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.Order] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Order", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, device_name: str, resource_group_name: str, order: Union[_models.Order, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(order, (IOBase, bytes)): - _content = order - else: - _json = self._serialize.body(order, "Order") - - _request = build_create_or_update_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - order: _models.Order, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Order]: - """Creates or updates an order. - - Creates or updates an order. - - :param device_name: The order details of a device. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param order: The order to be created or updated. Required. - :type order: ~azure.mgmt.databoxedge.v2019_08_01.models.Order - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Order or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Order] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - resource_group_name: str, - order: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Order]: - """Creates or updates an order. - - Creates or updates an order. - - :param device_name: The order details of a device. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param order: The order to be created or updated. Required. - :type order: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Order or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Order] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, device_name: str, resource_group_name: str, order: Union[_models.Order, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Order]: - """Creates or updates an order. - - Creates or updates an order. - - :param device_name: The order details of a device. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param order: The order to be created or updated. Is either a Order type or a IO[bytes] type. - Required. - :type order: ~azure.mgmt.databoxedge.v2019_08_01.models.Order or IO[bytes] - :return: An instance of LROPoller that returns either Order or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2019_08_01.models.Order] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Order] = 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_or_update_initial( - device_name=device_name, - resource_group_name=resource_group_name, - order=order, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Order", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Order].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Order]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, device_name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, device_name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the order related to the device. - - Deletes the order related to the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - device_name=device_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_skus_operations.py deleted file mode 100644 index 0b9a6ba487c9..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/operations/_skus_operations.py +++ /dev/null @@ -1,166 +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, 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.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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(subscription_id: str, *, filter: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/skus") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2019_08_01.DataBoxEdgeManagementClient`'s - :attr:`skus` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models.ResourceTypeSku"]: - """List all the available Skus in the region and information related to them. - - List all the available Skus in the region and information related to them. - - :param filter: Specify $filter='location eq :code:``' to filter on location. Default - value is None. - :type filter: str - :return: An iterator like instance of either ResourceTypeSku or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2019_08_01.models.ResourceTypeSku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) - cls: ClsType[_models.SkuInformationList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuInformationList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/py.typed b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_08_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/__init__.py deleted file mode 100644 index 0bedbc7bb26e..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/__init__.py +++ /dev/null @@ -1,32 +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. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._data_box_edge_management_client import DataBoxEdgeManagementClient # type: ignore -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxEdgeManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_configuration.py deleted file mode 100644 index 57e36b7f5023..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_configuration.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class DataBoxEdgeManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxEdgeManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription ID. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-02-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: - api_version: str = kwargs.pop("api_version", "2021-02-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-databoxedge/{}".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.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 - ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_data_box_edge_management_client.py deleted file mode 100644 index 84e18a57c212..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_data_box_edge_management_client.py +++ /dev/null @@ -1,221 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import HttpRequest, HttpResponse -from azure.mgmt.core import ARMPipelineClient -from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import DataBoxEdgeManagementClientConfiguration -from .operations import ( - AddonsOperations, - AlertsOperations, - AvailableSkusOperations, - BandwidthSchedulesOperations, - ContainersOperations, - DevicesOperations, - JobsOperations, - MonitoringConfigOperations, - NodesOperations, - Operations, - OperationsStatusOperations, - OrdersOperations, - RolesOperations, - SharesOperations, - StorageAccountCredentialsOperations, - StorageAccountsOperations, - TriggersOperations, - UsersOperations, -) - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class DataBoxEdgeManagementClient: # pylint: disable=too-many-instance-attributes - """The DataBoxEdge Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.v2021_02_01_preview.operations.Operations - :ivar available_skus: AvailableSkusOperations operations - :vartype available_skus: - azure.mgmt.databoxedge.v2021_02_01_preview.operations.AvailableSkusOperations - :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.v2021_02_01_preview.operations.DevicesOperations - :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.v2021_02_01_preview.operations.AlertsOperations - :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: - azure.mgmt.databoxedge.v2021_02_01_preview.operations.BandwidthSchedulesOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.v2021_02_01_preview.operations.JobsOperations - :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.v2021_02_01_preview.operations.NodesOperations - :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: - azure.mgmt.databoxedge.v2021_02_01_preview.operations.OperationsStatusOperations - :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.v2021_02_01_preview.operations.OrdersOperations - :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.v2021_02_01_preview.operations.RolesOperations - :ivar addons: AddonsOperations operations - :vartype addons: azure.mgmt.databoxedge.v2021_02_01_preview.operations.AddonsOperations - :ivar monitoring_config: MonitoringConfigOperations operations - :vartype monitoring_config: - azure.mgmt.databoxedge.v2021_02_01_preview.operations.MonitoringConfigOperations - :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.v2021_02_01_preview.operations.SharesOperations - :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: - azure.mgmt.databoxedge.v2021_02_01_preview.operations.StorageAccountCredentialsOperations - :ivar storage_accounts: StorageAccountsOperations operations - :vartype storage_accounts: - azure.mgmt.databoxedge.v2021_02_01_preview.operations.StorageAccountsOperations - :ivar containers: ContainersOperations operations - :vartype containers: azure.mgmt.databoxedge.v2021_02_01_preview.operations.ContainersOperations - :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.v2021_02_01_preview.operations.TriggersOperations - :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.v2021_02_01_preview.operations.UsersOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription ID. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-02-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 = DataBoxEdgeManagementClientConfiguration( - 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 - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.available_skus = AvailableSkusOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.devices = DevicesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.alerts = AlertsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.bandwidth_schedules = BandwidthSchedulesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview") - self.nodes = NodesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.operations_status = OperationsStatusOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.orders = OrdersOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.roles = RolesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.addons = AddonsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.monitoring_config = MonitoringConfigOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.shares = SharesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.storage_account_credentials = StorageAccountCredentialsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.storage_accounts = StorageAccountsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.containers = ContainersOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.triggers = TriggersOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.users = UsersOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.HttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - def close(self) -> None: - self._client.close() - - def __enter__(self) -> Self: - self._client.__enter__() - return self - - def __exit__(self, *exc_details: Any) -> None: - self._client.__exit__(*exc_details) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_metadata.json b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_metadata.json deleted file mode 100644 index 46cf434ecafa..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_metadata.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "chosen_version": "2021-02-01-preview", - "total_api_version_list": ["2021-02-01-preview"], - "client": { - "name": "DataBoxEdgeManagementClient", - "filename": "_data_box_edge_management_client", - "description": "The DataBoxEdge Client.", - "host_value": "\"https://management.azure.com\"", - "parameterized_host_template": null, - "azure_arm": true, - "has_public_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"DataBoxEdgeManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential: \"TokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true, - "method_location": "positional" - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The subscription ID. Required.", - "docstring_type": "str", - "required": true, - "method_location": "positional" - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure. Required.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The subscription ID. Required.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version: Optional[str]=None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles=KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "base_url": { - "signature": "base_url: str = \"https://management.azure.com\",", - "description": "Service URL", - "docstring_type": "str", - "required": false, - "method_location": "positional" - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false, - "method_location": "positional" - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", - "sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "operations": "Operations", - "available_skus": "AvailableSkusOperations", - "devices": "DevicesOperations", - "alerts": "AlertsOperations", - "bandwidth_schedules": "BandwidthSchedulesOperations", - "jobs": "JobsOperations", - "nodes": "NodesOperations", - "operations_status": "OperationsStatusOperations", - "orders": "OrdersOperations", - "roles": "RolesOperations", - "addons": "AddonsOperations", - "monitoring_config": "MonitoringConfigOperations", - "shares": "SharesOperations", - "storage_account_credentials": "StorageAccountCredentialsOperations", - "storage_accounts": "StorageAccountsOperations", - "containers": "ContainersOperations", - "triggers": "TriggersOperations", - "users": "UsersOperations" - } -} diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_version.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/_version.py deleted file mode 100644 index 48944bf3938a..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_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.0" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/__init__.py deleted file mode 100644 index c86847aa9e87..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/__init__.py +++ /dev/null @@ -1,29 +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. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._data_box_edge_management_client import DataBoxEdgeManagementClient # type: ignore - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "DataBoxEdgeManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_configuration.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_configuration.py deleted file mode 100644 index 444bce0d903c..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_configuration.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxEdgeManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for DataBoxEdgeManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription ID. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-02-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: - api_version: str = kwargs.pop("api_version", "2021-02-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-databoxedge/{}".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.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 - ) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_data_box_edge_management_client.py deleted file mode 100644 index 21c6308ededd..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_data_box_edge_management_client.py +++ /dev/null @@ -1,224 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING -from typing_extensions import Self - -from azure.core.pipeline import policies -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient -from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import DataBoxEdgeManagementClientConfiguration -from .operations import ( - AddonsOperations, - AlertsOperations, - AvailableSkusOperations, - BandwidthSchedulesOperations, - ContainersOperations, - DevicesOperations, - JobsOperations, - MonitoringConfigOperations, - NodesOperations, - Operations, - OperationsStatusOperations, - OrdersOperations, - RolesOperations, - SharesOperations, - StorageAccountCredentialsOperations, - StorageAccountsOperations, - TriggersOperations, - UsersOperations, -) - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class DataBoxEdgeManagementClient: # pylint: disable=too-many-instance-attributes - """The DataBoxEdge Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.Operations - :ivar available_skus: AvailableSkusOperations operations - :vartype available_skus: - azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.AvailableSkusOperations - :ivar devices: DevicesOperations operations - :vartype devices: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.DevicesOperations - :ivar alerts: AlertsOperations operations - :vartype alerts: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.AlertsOperations - :ivar bandwidth_schedules: BandwidthSchedulesOperations operations - :vartype bandwidth_schedules: - azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.BandwidthSchedulesOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.JobsOperations - :ivar nodes: NodesOperations operations - :vartype nodes: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.NodesOperations - :ivar operations_status: OperationsStatusOperations operations - :vartype operations_status: - azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.OperationsStatusOperations - :ivar orders: OrdersOperations operations - :vartype orders: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.OrdersOperations - :ivar roles: RolesOperations operations - :vartype roles: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.RolesOperations - :ivar addons: AddonsOperations operations - :vartype addons: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.AddonsOperations - :ivar monitoring_config: MonitoringConfigOperations operations - :vartype monitoring_config: - azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.MonitoringConfigOperations - :ivar shares: SharesOperations operations - :vartype shares: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.SharesOperations - :ivar storage_account_credentials: StorageAccountCredentialsOperations operations - :vartype storage_account_credentials: - azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.StorageAccountCredentialsOperations - :ivar storage_accounts: StorageAccountsOperations operations - :vartype storage_accounts: - azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.StorageAccountsOperations - :ivar containers: ContainersOperations operations - :vartype containers: - azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.ContainersOperations - :ivar triggers: TriggersOperations operations - :vartype triggers: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.TriggersOperations - :ivar users: UsersOperations operations - :vartype users: azure.mgmt.databoxedge.v2021_02_01_preview.aio.operations.UsersOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription ID. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-02-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 = DataBoxEdgeManagementClientConfiguration( - 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 - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.available_skus = AvailableSkusOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.devices = DevicesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.alerts = AlertsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.bandwidth_schedules = BandwidthSchedulesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview") - self.nodes = NodesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.operations_status = OperationsStatusOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.orders = OrdersOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.roles = RolesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.addons = AddonsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.monitoring_config = MonitoringConfigOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.shares = SharesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.storage_account_credentials = StorageAccountCredentialsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.storage_accounts = StorageAccountsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.containers = ContainersOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.triggers = TriggersOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - self.users = UsersOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-02-01-preview" - ) - - def _send_request( - self, request: HttpRequest, *, stream: bool = False, **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: - """Runs the network request through the client's chained policies. - - >>> from azure.core.rest import HttpRequest - >>> request = HttpRequest("GET", "https://www.example.org/") - - >>> response = await client._send_request(request) - - - For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request - - :param request: The network request you want to make. Required. - :type request: ~azure.core.rest.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to False. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.rest.AsyncHttpResponse - """ - - request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) - return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> Self: - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details: Any) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_alerts_operations.py deleted file mode 100644 index b7300f3d9798..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_alerts_operations.py +++ /dev/null @@ -1,203 +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, 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.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._alerts_operations import build_get_request, build_list_by_data_box_edge_device_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AlertsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`alerts` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Alert"]: - """Gets all the alerts for a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Alert or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Alert] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AlertList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Alert: - """Gets an alert by name. - - Gets an alert by name. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The alert name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Alert or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Alert - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Alert] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Alert", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_bandwidth_schedules_operations.py deleted file mode 100644 index 3f7feedf5145..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_bandwidth_schedules_operations.py +++ /dev/null @@ -1,534 +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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._bandwidth_schedules_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_data_box_edge_device_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BandwidthSchedulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`bandwidth_schedules` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.BandwidthSchedule"]: - """Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either BandwidthSchedule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.BandwidthSchedulesList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BandwidthSchedulesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> _models.BandwidthSchedule: - """Gets the properties of the specified bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: BandwidthSchedule or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.BandwidthSchedule] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BandwidthSchedule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - device_name: str, - name: str, - resource_group_name: str, - parameters: Union[_models.BandwidthSchedule, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "BandwidthSchedule") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - parameters: _models.BandwidthSchedule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BandwidthSchedule]: - """Creates or updates a bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name which needs to be added/updated. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The bandwidth schedule to be added or updated. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either BandwidthSchedule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BandwidthSchedule]: - """Creates or updates a bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name which needs to be added/updated. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The bandwidth schedule to be added or updated. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either BandwidthSchedule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - parameters: Union[_models.BandwidthSchedule, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BandwidthSchedule]: - """Creates or updates a bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name which needs to be added/updated. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The bandwidth schedule to be added or updated. Is either a BandwidthSchedule - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either BandwidthSchedule or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BandwidthSchedule] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BandwidthSchedule", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BandwidthSchedule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BandwidthSchedule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_containers_operations.py deleted file mode 100644 index 6247fb334034..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_containers_operations.py +++ /dev/null @@ -1,684 +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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._containers_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_storage_account_request, - build_refresh_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`containers` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_storage_account( - self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Container"]: - """Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - - Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The storage Account name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Container or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.ContainerList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_storage_account_request( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ContainerList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.Container: - """Gets a container by name. - - Gets a container by name. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container Name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Container or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Container] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Container", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - device_name: str, - storage_account_name: str, - container_name: str, - resource_group_name: str, - container: Union[_models.Container, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(container, (IOBase, bytes)): - _content = container - else: - _json = self._serialize.body(container, "Container") - - _request = build_create_or_update_request( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - container_name: str, - resource_group_name: str, - container: _models.Container, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Container]: - """Creates a new container or updates an existing container on the device. - - Creates a new container or updates an existing container on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param container: The container properties. Required. - :type container: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Container or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - container_name: str, - resource_group_name: str, - container: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Container]: - """Creates a new container or updates an existing container on the device. - - Creates a new container or updates an existing container on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param container: The container properties. Required. - :type container: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Container or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - container_name: str, - resource_group_name: str, - container: Union[_models.Container, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Container]: - """Creates a new container or updates an existing container on the device. - - Creates a new container or updates an existing container on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param container: The container properties. Is either a Container type or a IO[bytes] type. - Required. - :type container: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Container or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Container] = 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_or_update_initial( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - container=container, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Container", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Container].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Container]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the container on the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _refresh_initial( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_request( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_refresh( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Refreshes the container metadata with the data from the cloud. - - Refreshes the container metadata with the data from the cloud. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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._refresh_initial( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_jobs_operations.py deleted file mode 100644 index bbb8d441a2c4..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,115 +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, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._jobs_operations import build_get_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class JobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`jobs` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace_async - async def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Job: - """Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - - Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The job name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Job] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Job", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations.py deleted file mode 100644 index a5d58ab67d4d..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations.py +++ /dev/null @@ -1,134 +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, 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.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: - """List all the supported operations. - - List all the supported operations. - - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.OperationsList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations_status_operations.py deleted file mode 100644 index a62bed3a67d3..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_operations_status_operations.py +++ /dev/null @@ -1,115 +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, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._operations_status_operations import build_get_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class OperationsStatusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`operations_status` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace_async - async def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Job: - """Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - - Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The job name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Job] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Job", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_roles_operations.py deleted file mode 100644 index d731abab7d0b..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_roles_operations.py +++ /dev/null @@ -1,517 +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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._roles_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_data_box_edge_device_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class RolesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`roles` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Role"]: - """Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Role or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.RoleList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RoleList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Role: - """Gets a specific role by name. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Role or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Role] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Role", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, device_name: str, name: str, resource_group_name: str, role: Union[_models.Role, IO[bytes]], **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(role, (IOBase, bytes)): - _content = role - else: - _json = self._serialize.body(role, "Role") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - role: _models.Role, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Role]: - """Create or update a role. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param role: The role properties. Required. - :type role: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Role or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - role: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Role]: - """Create or update a role. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param role: The role properties. Required. - :type role: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Role or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, device_name: str, name: str, resource_group_name: str, role: Union[_models.Role, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Role]: - """Create or update a role. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param role: The role properties. Is either a Role type or a IO[bytes] type. Required. - :type role: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Role or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Role] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - role=role, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Role", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Role].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Role]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the role on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_shares_operations.py deleted file mode 100644 index 2c090a8f05b5..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_shares_operations.py +++ /dev/null @@ -1,652 +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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._shares_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_data_box_edge_device_request, - build_refresh_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SharesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`shares` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Share"]: - """Lists all the shares in a Data Box Edge/Data Box Gateway device. - - Lists all the shares in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Share or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.ShareList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ShareList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Share: - """Gets a share by name. - - Gets a share by name. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Share or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Share] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Share", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - device_name: str, - name: str, - resource_group_name: str, - share: Union[_models.Share, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(share, (IOBase, bytes)): - _content = share - else: - _json = self._serialize.body(share, "Share") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - share: _models.Share, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Share]: - """Creates a new share or updates an existing share on the device. - - Creates a new share or updates an existing share on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param share: The share properties. Required. - :type share: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Share or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - share: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Share]: - """Creates a new share or updates an existing share on the device. - - Creates a new share or updates an existing share on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param share: The share properties. Required. - :type share: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Share or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - share: Union[_models.Share, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Share]: - """Creates a new share or updates an existing share on the device. - - Creates a new share or updates an existing share on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param share: The share properties. Is either a Share type or a IO[bytes] type. Required. - :type share: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Share or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Share] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - share=share, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Share", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Share].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Share]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the share on the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _refresh_initial( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_refresh( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Refreshes the share metadata with the data from the cloud. - - Refreshes the share metadata with the data from the cloud. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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._refresh_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_account_credentials_operations.py deleted file mode 100644 index 7bccb14987d7..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_account_credentials_operations.py +++ /dev/null @@ -1,539 +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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._storage_account_credentials_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_data_box_edge_device_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class StorageAccountCredentialsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`storage_account_credentials` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StorageAccountCredential"]: - # pylint: disable=line-too-long - """Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - - Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either StorageAccountCredential or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.StorageAccountCredentialList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("StorageAccountCredentialList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> _models.StorageAccountCredential: - """Gets the properties of the specified storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: StorageAccountCredential or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.StorageAccountCredential] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("StorageAccountCredential", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - device_name: str, - name: str, - resource_group_name: str, - storage_account_credential: Union[_models.StorageAccountCredential, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(storage_account_credential, (IOBase, bytes)): - _content = storage_account_credential - else: - _json = self._serialize.body(storage_account_credential, "StorageAccountCredential") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - storage_account_credential: _models.StorageAccountCredential, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.StorageAccountCredential]: - """Creates or updates the storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account_credential: The storage account credential. Required. - :type storage_account_credential: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either StorageAccountCredential or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - storage_account_credential: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.StorageAccountCredential]: - """Creates or updates the storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account_credential: The storage account credential. Required. - :type storage_account_credential: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either StorageAccountCredential or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - storage_account_credential: Union[_models.StorageAccountCredential, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.StorageAccountCredential]: - """Creates or updates the storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account_credential: The storage account credential. Is either a - StorageAccountCredential type or a IO[bytes] type. Required. - :type storage_account_credential: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential or IO[bytes] - :return: An instance of AsyncLROPoller that returns either StorageAccountCredential or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StorageAccountCredential] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - storage_account_credential=storage_account_credential, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("StorageAccountCredential", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.StorageAccountCredential].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.StorageAccountCredential]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_accounts_operations.py deleted file mode 100644 index 6f657225e89c..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_storage_accounts_operations.py +++ /dev/null @@ -1,544 +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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._storage_accounts_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_data_box_edge_device_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class StorageAccountsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`storage_accounts` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.StorageAccount"]: - """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. - - Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either StorageAccount or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.StorageAccountList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("StorageAccountList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.StorageAccount: - """Gets a StorageAccount by name. - - Gets a StorageAccount by name. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The storage account name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: StorageAccount or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("StorageAccount", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - device_name: str, - storage_account_name: str, - resource_group_name: str, - storage_account: Union[_models.StorageAccount, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(storage_account, (IOBase, bytes)): - _content = storage_account - else: - _json = self._serialize.body(storage_account, "StorageAccount") - - _request = build_create_or_update_request( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - resource_group_name: str, - storage_account: _models.StorageAccount, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.StorageAccount]: - """Creates a new StorageAccount or updates an existing StorageAccount on the device. - - Creates a new StorageAccount or updates an existing StorageAccount on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The StorageAccount name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account: The StorageAccount properties. Required. - :type storage_account: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - resource_group_name: str, - storage_account: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.StorageAccount]: - """Creates a new StorageAccount or updates an existing StorageAccount on the device. - - Creates a new StorageAccount or updates an existing StorageAccount on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The StorageAccount name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account: The StorageAccount properties. Required. - :type storage_account: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - resource_group_name: str, - storage_account: Union[_models.StorageAccount, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.StorageAccount]: - """Creates a new StorageAccount or updates an existing StorageAccount on the device. - - Creates a new StorageAccount or updates an existing StorageAccount on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The StorageAccount name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account: The StorageAccount properties. Is either a StorageAccount type or a - IO[bytes] type. Required. - :type storage_account: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StorageAccount] = 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_or_update_initial( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - storage_account=storage_account, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("StorageAccount", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.StorageAccount].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.StorageAccount]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The StorageAccount name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_triggers_operations.py deleted file mode 100644 index 05554b41fe2b..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_triggers_operations.py +++ /dev/null @@ -1,534 +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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._triggers_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_data_box_edge_device_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class TriggersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`triggers` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Trigger"]: - """Lists all the triggers configured in the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param filter: Specify $filter='CustomContextTag eq :code:``' to filter on custom context - tag property. Default value is None. - :type filter: str - :return: An iterator like instance of either Trigger or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.TriggerList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TriggerList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Trigger: - """Get a specific trigger by name. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Trigger or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Trigger] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Trigger", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - device_name: str, - name: str, - resource_group_name: str, - trigger: Union[_models.Trigger, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(trigger, (IOBase, bytes)): - _content = trigger - else: - _json = self._serialize.body(trigger, "Trigger") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - trigger: _models.Trigger, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Trigger]: - """Creates or updates a trigger. - - :param device_name: Creates or updates a trigger. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param trigger: The trigger. Required. - :type trigger: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Trigger or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - trigger: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Trigger]: - """Creates or updates a trigger. - - :param device_name: Creates or updates a trigger. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param trigger: The trigger. Required. - :type trigger: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Trigger or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - trigger: Union[_models.Trigger, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Trigger]: - """Creates or updates a trigger. - - :param device_name: Creates or updates a trigger. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param trigger: The trigger. Is either a Trigger type or a IO[bytes] type. Required. - :type trigger: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Trigger or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Trigger] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - trigger=trigger, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Trigger", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Trigger].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Trigger]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the trigger on the gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_users_operations.py deleted file mode 100644 index d17d95a76a11..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/aio/operations/_users_operations.py +++ /dev/null @@ -1,525 +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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, 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, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._users_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_data_box_edge_device_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class UsersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.aio.DataBoxEdgeManagementClient`'s - :attr:`users` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.User"]: - """Gets all the users registered on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param expand: Specify $expand=details to populate additional fields related to the resource or - Specify $skipToken=\\ :code:`` to populate the next page in the list. Default value is - None. - :type expand: str - :return: An iterator like instance of either User or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.UserList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("UserList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.User: - """Gets the properties of the specified user. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: User or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.User] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("User", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, device_name: str, name: str, resource_group_name: str, user: Union[_models.User, IO[bytes]], **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(user, (IOBase, bytes)): - _content = user - else: - _json = self._serialize.body(user, "User") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - user: _models.User, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.User]: - """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box - Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param user: The user details. Required. - :type user: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either User or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - user: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.User]: - """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box - Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param user: The user details. Required. - :type user: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either User or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, device_name: str, name: str, resource_group_name: str, user: Union[_models.User, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.User]: - """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box - Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param user: The user details. Is either a User type or a IO[bytes] type. Required. - :type user: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User or IO[bytes] - :return: An instance of AsyncLROPoller that returns either User or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.User] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - user=user, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("User", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.User].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.User]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the user on a databox edge/gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_alerts_operations.py deleted file mode 100644 index 12416c273f87..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_alerts_operations.py +++ /dev/null @@ -1,267 +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, 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.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class AlertsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`alerts` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Alert"]: - """Gets all the alerts for a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Alert or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Alert] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AlertList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Alert: - """Gets an alert by name. - - Gets an alert by name. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The alert name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Alert or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Alert - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Alert] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Alert", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_bandwidth_schedules_operations.py deleted file mode 100644 index ca1ab7dd7bea..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_bandwidth_schedules_operations.py +++ /dev/null @@ -1,655 +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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class BandwidthSchedulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`bandwidth_schedules` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.BandwidthSchedule"]: - """Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either BandwidthSchedule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.BandwidthSchedulesList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BandwidthSchedulesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.BandwidthSchedule: - """Gets the properties of the specified bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: BandwidthSchedule or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.BandwidthSchedule] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BandwidthSchedule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - device_name: str, - name: str, - resource_group_name: str, - parameters: Union[_models.BandwidthSchedule, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "BandwidthSchedule") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - parameters: _models.BandwidthSchedule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BandwidthSchedule]: - """Creates or updates a bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name which needs to be added/updated. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The bandwidth schedule to be added or updated. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either BandwidthSchedule or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BandwidthSchedule]: - """Creates or updates a bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name which needs to be added/updated. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The bandwidth schedule to be added or updated. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either BandwidthSchedule or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - parameters: Union[_models.BandwidthSchedule, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BandwidthSchedule]: - """Creates or updates a bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name which needs to be added/updated. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param parameters: The bandwidth schedule to be added or updated. Is either a BandwidthSchedule - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule or - IO[bytes] - :return: An instance of LROPoller that returns either BandwidthSchedule or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.BandwidthSchedule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BandwidthSchedule] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BandwidthSchedule", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BandwidthSchedule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BandwidthSchedule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the specified bandwidth schedule. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The bandwidth schedule name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_containers_operations.py deleted file mode 100644 index edf67b78c853..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_containers_operations.py +++ /dev/null @@ -1,864 +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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_storage_account_request( - device_name: str, storage_account_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - device_name: str, - storage_account_name: str, - container_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_name: str, - storage_account_name: str, - container_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_name: str, - storage_account_name: str, - container_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_refresh_request( - device_name: str, - storage_account_name: str, - container_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ContainersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`containers` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_storage_account( - self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Container"]: - """Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - - Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The storage Account name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Container or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.ContainerList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_storage_account_request( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ContainerList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.Container: - """Gets a container by name. - - Gets a container by name. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container Name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Container or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Container] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Container", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - device_name: str, - storage_account_name: str, - container_name: str, - resource_group_name: str, - container: Union[_models.Container, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(container, (IOBase, bytes)): - _content = container - else: - _json = self._serialize.body(container, "Container") - - _request = build_create_or_update_request( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - container_name: str, - resource_group_name: str, - container: _models.Container, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Container]: - """Creates a new container or updates an existing container on the device. - - Creates a new container or updates an existing container on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param container: The container properties. Required. - :type container: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Container or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - container_name: str, - resource_group_name: str, - container: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Container]: - """Creates a new container or updates an existing container on the device. - - Creates a new container or updates an existing container on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param container: The container properties. Required. - :type container: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Container or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - container_name: str, - resource_group_name: str, - container: Union[_models.Container, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Container]: - """Creates a new container or updates an existing container on the device. - - Creates a new container or updates an existing container on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param container: The container properties. Is either a Container type or a IO[bytes] type. - Required. - :type container: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container or IO[bytes] - :return: An instance of LROPoller that returns either Container or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Container] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Container] = 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_or_update_initial( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - container=container, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Container", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Container].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Container]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the container on the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _refresh_initial( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_request( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_refresh( - self, device_name: str, storage_account_name: str, container_name: str, resource_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Refreshes the container metadata with the data from the cloud. - - Refreshes the container metadata with the data from the cloud. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The Storage Account Name. Required. - :type storage_account_name: str - :param container_name: The container name. Required. - :type container_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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._refresh_initial( - device_name=device_name, - storage_account_name=storage_account_name, - container_name=container_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_jobs_operations.py deleted file mode 100644 index 35f1a8bd6600..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_jobs_operations.py +++ /dev/null @@ -1,150 +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, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`jobs` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Job: - """Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - - Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The job name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Job] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Job", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations.py deleted file mode 100644 index df8b13d50c2e..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations.py +++ /dev/null @@ -1,156 +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, 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.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.DataBoxEdge/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.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """List all the supported operations. - - List all the supported operations. - - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.OperationsList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations_status_operations.py deleted file mode 100644 index cb7c99d9043c..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_operations_status_operations.py +++ /dev/null @@ -1,150 +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, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from ..._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class OperationsStatusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`operations_status` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Job: - """Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - - Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The job name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Job] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Job", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_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/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_roles_operations.py deleted file mode 100644 index 3e34137a4358..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_roles_operations.py +++ /dev/null @@ -1,636 +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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class RolesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`roles` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Role"]: - """Lists all the roles configured in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Role or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.RoleList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RoleList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Role: - """Gets a specific role by name. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Role or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Role] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Role", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, device_name: str, name: str, resource_group_name: str, role: Union[_models.Role, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(role, (IOBase, bytes)): - _content = role - else: - _json = self._serialize.body(role, "Role") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - role: _models.Role, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Role]: - """Create or update a role. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param role: The role properties. Required. - :type role: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Role or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - role: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Role]: - """Create or update a role. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param role: The role properties. Required. - :type role: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Role or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, device_name: str, name: str, resource_group_name: str, role: Union[_models.Role, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Role]: - """Create or update a role. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param role: The role properties. Is either a Role type or a IO[bytes] type. Required. - :type role: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role or IO[bytes] - :return: An instance of LROPoller that returns either Role or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Role] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Role] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - role=role, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Role", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Role].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Role]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the role on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The role name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_shares_operations.py deleted file mode 100644 index 52e7bb3f6f31..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_shares_operations.py +++ /dev/null @@ -1,798 +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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_refresh_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class SharesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`shares` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.Share"]: - """Lists all the shares in a Data Box Edge/Data Box Gateway device. - - Lists all the shares in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either Share or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.ShareList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ShareList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Share: - """Gets a share by name. - - Gets a share by name. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Share or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Share] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Share", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - device_name: str, - name: str, - resource_group_name: str, - share: Union[_models.Share, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(share, (IOBase, bytes)): - _content = share - else: - _json = self._serialize.body(share, "Share") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - share: _models.Share, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Share]: - """Creates a new share or updates an existing share on the device. - - Creates a new share or updates an existing share on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param share: The share properties. Required. - :type share: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Share or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - share: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Share]: - """Creates a new share or updates an existing share on the device. - - Creates a new share or updates an existing share on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param share: The share properties. Required. - :type share: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Share or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - share: Union[_models.Share, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Share]: - """Creates a new share or updates an existing share on the device. - - Creates a new share or updates an existing share on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param share: The share properties. Is either a Share type or a IO[bytes] type. Required. - :type share: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share or IO[bytes] - :return: An instance of LROPoller that returns either Share or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Share] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Share] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - share=share, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Share", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Share].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Share]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the share on the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _refresh_initial(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_refresh(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Refreshes the share metadata with the data from the cloud. - - Refreshes the share metadata with the data from the cloud. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The share name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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._refresh_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_account_credentials_operations.py deleted file mode 100644 index 40e611550538..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_account_credentials_operations.py +++ /dev/null @@ -1,661 +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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class StorageAccountCredentialsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`storage_account_credentials` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.StorageAccountCredential"]: - """Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - - Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either StorageAccountCredential or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.StorageAccountCredentialList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("StorageAccountCredentialList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, device_name: str, name: str, resource_group_name: str, **kwargs: Any - ) -> _models.StorageAccountCredential: - """Gets the properties of the specified storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: StorageAccountCredential or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.StorageAccountCredential] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("StorageAccountCredential", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - device_name: str, - name: str, - resource_group_name: str, - storage_account_credential: Union[_models.StorageAccountCredential, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(storage_account_credential, (IOBase, bytes)): - _content = storage_account_credential - else: - _json = self._serialize.body(storage_account_credential, "StorageAccountCredential") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - storage_account_credential: _models.StorageAccountCredential, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.StorageAccountCredential]: - """Creates or updates the storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account_credential: The storage account credential. Required. - :type storage_account_credential: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either StorageAccountCredential or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - storage_account_credential: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.StorageAccountCredential]: - """Creates or updates the storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account_credential: The storage account credential. Required. - :type storage_account_credential: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either StorageAccountCredential or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - storage_account_credential: Union[_models.StorageAccountCredential, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.StorageAccountCredential]: - """Creates or updates the storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account_credential: The storage account credential. Is either a - StorageAccountCredential type or a IO[bytes] type. Required. - :type storage_account_credential: - ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential or IO[bytes] - :return: An instance of LROPoller that returns either StorageAccountCredential or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccountCredential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StorageAccountCredential] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - storage_account_credential=storage_account_credential, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("StorageAccountCredential", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.StorageAccountCredential].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.StorageAccountCredential]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the storage account credential. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The storage account credential name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_accounts_operations.py deleted file mode 100644 index fbc7095b9cef..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_storage_accounts_operations.py +++ /dev/null @@ -1,671 +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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - device_name: str, storage_account_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_name: str, storage_account_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_name: str, storage_account_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "storageAccountName": _SERIALIZER.url("storage_account_name", storage_account_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class StorageAccountsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`storage_accounts` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.StorageAccount"]: - """Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. - - Lists all the StorageAccounts in a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An iterator like instance of either StorageAccount or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.StorageAccountList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("StorageAccountList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> _models.StorageAccount: - """Gets a StorageAccount by name. - - Gets a StorageAccount by name. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The storage account name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: StorageAccount or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.StorageAccount] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("StorageAccount", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - device_name: str, - storage_account_name: str, - resource_group_name: str, - storage_account: Union[_models.StorageAccount, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(storage_account, (IOBase, bytes)): - _content = storage_account - else: - _json = self._serialize.body(storage_account, "StorageAccount") - - _request = build_create_or_update_request( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - resource_group_name: str, - storage_account: _models.StorageAccount, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.StorageAccount]: - """Creates a new StorageAccount or updates an existing StorageAccount on the device. - - Creates a new StorageAccount or updates an existing StorageAccount on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The StorageAccount name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account: The StorageAccount properties. Required. - :type storage_account: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either StorageAccount or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - resource_group_name: str, - storage_account: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.StorageAccount]: - """Creates a new StorageAccount or updates an existing StorageAccount on the device. - - Creates a new StorageAccount or updates an existing StorageAccount on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The StorageAccount name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account: The StorageAccount properties. Required. - :type storage_account: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either StorageAccount or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - device_name: str, - storage_account_name: str, - resource_group_name: str, - storage_account: Union[_models.StorageAccount, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.StorageAccount]: - """Creates a new StorageAccount or updates an existing StorageAccount on the device. - - Creates a new StorageAccount or updates an existing StorageAccount on the device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The StorageAccount name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param storage_account: The StorageAccount properties. Is either a StorageAccount type or a - IO[bytes] type. Required. - :type storage_account: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount or - IO[bytes] - :return: An instance of LROPoller that returns either StorageAccount or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.StorageAccount] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StorageAccount] = 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_or_update_initial( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - storage_account=storage_account, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("StorageAccount", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.StorageAccount].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.StorageAccount]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, device_name: str, storage_account_name: str, resource_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param storage_account_name: The StorageAccount name. Required. - :type storage_account_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - storage_account_name=storage_account_name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_triggers_operations.py deleted file mode 100644 index 535fa33d4c1e..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_triggers_operations.py +++ /dev/null @@ -1,656 +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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_name: str, resource_group_name: str, subscription_id: str, *, filter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class TriggersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`triggers` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Trigger"]: - """Lists all the triggers configured in the device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param filter: Specify $filter='CustomContextTag eq :code:``' to filter on custom context - tag property. Default value is None. - :type filter: str - :return: An iterator like instance of either Trigger or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.TriggerList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TriggerList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.Trigger: - """Get a specific trigger by name. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: Trigger or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.Trigger] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Trigger", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - device_name: str, - name: str, - resource_group_name: str, - trigger: Union[_models.Trigger, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(trigger, (IOBase, bytes)): - _content = trigger - else: - _json = self._serialize.body(trigger, "Trigger") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - trigger: _models.Trigger, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Trigger]: - """Creates or updates a trigger. - - :param device_name: Creates or updates a trigger. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param trigger: The trigger. Required. - :type trigger: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Trigger or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - trigger: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Trigger]: - """Creates or updates a trigger. - - :param device_name: Creates or updates a trigger. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param trigger: The trigger. Required. - :type trigger: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Trigger or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - trigger: Union[_models.Trigger, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Trigger]: - """Creates or updates a trigger. - - :param device_name: Creates or updates a trigger. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param trigger: The trigger. Is either a Trigger type or a IO[bytes] type. Required. - :type trigger: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger or IO[bytes] - :return: An instance of LROPoller that returns either Trigger or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.Trigger] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Trigger] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - trigger=trigger, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Trigger", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Trigger].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Trigger]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the trigger on the gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The trigger name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_users_operations.py deleted file mode 100644 index 550a158d3961..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/operations/_users_operations.py +++ /dev/null @@ -1,646 +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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -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_data_box_edge_device_request( # pylint: disable=name-too-long - device_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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if 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_get_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - device_name: str, 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: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), - "name": _SERIALIZER.url("name", name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class UsersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.databoxedge.v2021_02_01_preview.DataBoxEdgeManagementClient`'s - :attr:`users` 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_data_box_edge_device( - self, device_name: str, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.User"]: - """Gets all the users registered on a Data Box Edge/Data Box Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param expand: Specify $expand=details to populate additional fields related to the resource or - Specify $skipToken=\\ :code:`` to populate the next page in the list. Default value is - None. - :type expand: str - :return: An iterator like instance of either User or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.UserList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_data_box_edge_device_request( - device_name=device_name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("UserList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> _models.User: - """Gets the properties of the specified user. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: User or the result of cls(response) - :rtype: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[_models.User] = kwargs.pop("cls", None) - - _request = build_get_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("User", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, device_name: str, name: str, resource_group_name: str, user: Union[_models.User, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(user, (IOBase, bytes)): - _content = user - else: - _json = self._serialize.body(user, "User") - - _request = build_create_or_update_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - user: _models.User, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.User]: - """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box - Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param user: The user details. Required. - :type user: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either User or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - device_name: str, - name: str, - resource_group_name: str, - user: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.User]: - """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box - Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param user: The user details. Required. - :type user: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either User or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, device_name: str, name: str, resource_group_name: str, user: Union[_models.User, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.User]: - """Creates a new user or updates an existing user's information on a Data Box Edge/Data Box - Gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :param user: The user details. Is either a User type or a IO[bytes] type. Required. - :type user: ~azure.mgmt.databoxedge.v2021_02_01_preview.models.User or IO[bytes] - :return: An instance of LROPoller that returns either User or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.databoxedge.v2021_02_01_preview.models.User] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.User] = 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_or_update_initial( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - user=user, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("User", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.User].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.User]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, device_name: str, name: str, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the user on a databox edge/gateway device. - - :param device_name: The device name. Required. - :type device_name: str - :param name: The user name. Required. - :type name: str - :param resource_group_name: The resource group name. Required. - :type resource_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop( - "api_version", _params.pop("api-version", self._api_version or "2021-02-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( - device_name=device_name, - name=name, - resource_group_name=resource_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/py.typed b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2021_02_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/alert_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/alert_get.py index 83317539ddee..f83f54a00d1d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/alert_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/alert_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/AlertGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/AlertGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/alert_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/alert_get_all_in_device.py index 614d5431052b..11e83762f4c2 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/alert_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/alert_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/AlertGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/AlertGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/available_skus_list.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/available_skus_list.py index b5c0545ef5a9..4a9578a978fb 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/available_skus_list.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/available_skus_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -34,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/AvailableSkusList.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/AvailableSkusList.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_delete.py index c087516d869c..67095ae3a655 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/BandwidthScheduleDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/BandwidthScheduleDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_get.py index 14accc4e1370..955da8176b39 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/BandwidthScheduleGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/BandwidthScheduleGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_get_all_in_device.py index 669813515e56..e4c0b855117c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/BandwidthScheduleGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/BandwidthScheduleGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_put.py index a843d318d8a2..4d8f67f31b65 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/bandwidth_schedule_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/BandwidthSchedulePut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/BandwidthSchedulePut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_delete.py index 42c38aa272e6..17d3f13c87d2 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ContainerDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_get.py index e038ea394f1d..dbc3b4af0bca 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ContainerGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_list_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_list_all_in_device.py index 0708191add52..2ffa06956df1 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_list_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_list_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerListAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ContainerListAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_put.py index 998c59eb1458..e0a9be283b26 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerPut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ContainerPut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_refresh.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_refresh.py index a6886fa92c61..00aa102dcf19 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_refresh.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/container_refresh.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ContainerRefresh.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ContainerRefresh.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_delete.py index dda1a8cfc6a4..254015ba192f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DataBoxEdgeDeviceDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/DataBoxEdgeDeviceDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_name.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_name.py index 498e89c751f9..57c6e8397ecf 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_name.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_name.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DataBoxEdgeDeviceGetByName.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/DataBoxEdgeDeviceGetByName.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_name_with_data_residency.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_name_with_data_residency.py deleted file mode 100644 index 52a2f81e191c..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_name_with_data_residency.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python data_box_edge_device_get_by_name_with_data_residency.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.devices.get( - device_name="testedgedevice", - resource_group_name="GroupForEdgeAutomation", - ) - print(response) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DataBoxEdgeDeviceGetByNameWithDataResidency.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_resource_group.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_resource_group.py index 8c3744093363..5d6ddb6d43cc 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_resource_group.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_resource_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DataBoxEdgeDeviceGetByResourceGroup.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/DataBoxEdgeDeviceGetByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_subscription.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_subscription.py index 594104f262e0..b87e8b08a95f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_subscription.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_get_by_subscription.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DataBoxEdgeDeviceGetBySubscription.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/DataBoxEdgeDeviceGetBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_patch.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_patch.py index 3aa5c12d72ac..f3c666e56d63 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_patch.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_patch.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -33,11 +34,19 @@ def main(): response = client.devices.update( device_name="testedgedevice", resource_group_name="GroupForEdgeAutomation", - parameters={"tags": {"Key1": "value1", "Key2": "value2"}}, + parameters={ + "properties": { + "edgeProfile": { + "subscription": { + "id": "/subscriptions/0d44739e-0563-474f-97e7-24a0cdb23b29/resourceGroups/rapvs-rg/providers/Microsoft.AzureStack/linkedSubscriptions/ca014ddc-5cf2-45f8-b390-e901e4a0ae87" + } + } + } + }, ) print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DataBoxEdgeDevicePatch.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/DataBoxEdgeDevicePatch.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_put.py index 505efa2a93bd..f11afdd47649 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -29,14 +31,14 @@ def main(): subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", ) - response = client.devices.create_or_update( + response = client.devices.begin_create_or_update( device_name="testedgedevice", resource_group_name="GroupForEdgeAutomation", data_box_edge_device={"location": "WUS", "sku": {"name": "Edge", "tier": "Standard"}, "tags": {}}, - ) + ).result() print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DataBoxEdgeDevicePut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/DataBoxEdgeDevicePut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_put_with_data_residency.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_put_with_data_residency.py deleted file mode 100644 index 53c6b47376dc..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/data_box_edge_device_put_with_data_residency.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python data_box_edge_device_put_with_data_residency.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.devices.create_or_update( - device_name="testedgedevice", - resource_group_name="GroupForEdgeAutomation", - data_box_edge_device={ - "location": "WUS", - "properties": {"dataResidency": {"type": "ZoneReplication"}}, - "sku": {"name": "Edge", "tier": "Standard"}, - "tags": {}, - }, - ) - print(response) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DataBoxEdgeDevicePutWithDataResidency.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/delete_addons.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/delete_addons.py index a7797ceb40e7..9b57d31918ed 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/delete_addons.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/delete_addons.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -29,15 +31,14 @@ def main(): subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", ) - response = client.addons.begin_delete( + client.addons.begin_delete( device_name="testedgedevice", role_name="KubernetesRole", addon_name="arcName", resource_group_name="GroupForEdgeAutomation", ).result() - print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DeleteAddons.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/DeleteAddons.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/delete_monitoring_config.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/delete_monitoring_config.py index 8c77347a089f..65b61ea6089e 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/delete_monitoring_config.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/delete_monitoring_config.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -29,14 +31,13 @@ def main(): subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", ) - response = client.monitoring_config.begin_delete( + client.monitoring_config.begin_delete( device_name="testedgedevice", role_name="testrole", resource_group_name="GroupForEdgeAutomation", ).result() - print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DeleteMonitoringConfig.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/DeleteMonitoringConfig.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/device_capacity_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/device_capacity_get.py deleted file mode 100644 index ddd1601e51cb..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/device_capacity_get.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python device_capacity_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.device_capacity_info.get_device_capacity_info( - resource_group_name="GroupForEdgeAutomation", - device_name="testedgedevice", - ) - print(response) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DeviceCapacityGet.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/device_capacity_request_post.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/device_capacity_request_post.py deleted file mode 100644 index babc7191b2d5..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/device_capacity_request_post.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python device_capacity_request_post.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.device_capacity_check.begin_check_resource_creation_feasibility( - resource_group_name="GroupForEdgeAutomation", - device_name="testedgedevice", - device_capacity_request_info={"properties": {"vmPlacementQuery": [["Standard_D2_v2"]]}}, - ).result() - print(response) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/DeviceCapacityRequestPost.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/download_updates_post.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/download_updates_post.py index 42a2ef12e7ec..d3a9f3a7d6e0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/download_updates_post.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/download_updates_post.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/DownloadUpdatesPost.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/DownloadUpdatesPost.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/extended_info_post.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/extended_info_post.py index 6685a100f8bb..545f48950291 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/extended_info_post.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/extended_info_post.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ExtendedInfoPost.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ExtendedInfoPost.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/generate_certificate.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/generate_certificate.py index 56f2724954a5..593dfca58a53 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/generate_certificate.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/generate_certificate.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -36,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GenerateCertificate.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/GenerateCertificate.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_addons.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_addons.py index 4c226665495c..907a210f41c7 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_addons.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_addons.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -38,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetAddons.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/GetAddons.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_dc_access_code.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_dc_access_code.py index 43396551cadd..e8ffbb580a74 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_dc_access_code.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_dc_access_code.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -36,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetDCAccessCode.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/GetDCAccessCode.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_diagnostic_proactive_log_collection_settings.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_diagnostic_proactive_log_collection_settings.py deleted file mode 100644 index e20525058719..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_diagnostic_proactive_log_collection_settings.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python get_diagnostic_proactive_log_collection_settings.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.diagnostic_settings.get_diagnostic_proactive_log_collection_settings( - device_name="testedgedevice", - resource_group_name="GroupForEdgeAutomation", - ) - print(response) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetDiagnosticProactiveLogCollectionSettings.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_diagnostic_remote_support_settings.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_diagnostic_remote_support_settings.py deleted file mode 100644 index dad437f6af52..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_diagnostic_remote_support_settings.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python get_diagnostic_remote_support_settings.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.diagnostic_settings.get_diagnostic_remote_support_settings( - device_name="testedgedevice", - resource_group_name="GroupForEdgeAutomation", - ) - print(response) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetDiagnosticRemoteSupportSettings.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_monitoring_config.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_monitoring_config.py index f7060de4a87a..0fa7be0bff74 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_monitoring_config.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/get_monitoring_config.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -37,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/GetMonitoringConfig.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/GetMonitoringConfig.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/install_updates_post.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/install_updates_post.py index 58a14a1a5b85..0ff5604bf592 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/install_updates_post.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/install_updates_post.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/InstallUpdatesPost.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/InstallUpdatesPost.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/jobs_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/jobs_get.py index 4ed1a6117abf..4f4fd0e10d2f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/jobs_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/jobs_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/JobsGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/JobsGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/list_monitoring_config.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/list_monitoring_config.py index d55c471d77c4..7161a3480fe7 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/list_monitoring_config.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/list_monitoring_config.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -38,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/ListMonitoringConfig.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ListMonitoringConfig.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/list_skus.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/list_skus.py deleted file mode 100644 index 2dd8d82c9b7f..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/list_skus.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python list_skus.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.skus.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ListSkus.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/network_settings_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/network_settings_get.py index 23494a6e5d40..b0dd7f570412 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/network_settings_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/network_settings_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/NetworkSettingsGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/NetworkSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/node_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/node_get_all_in_device.py index 3d42c7cd40eb..30e6eeae01b0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/node_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/node_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/NodeGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/NodeGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/operations_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/operations_get.py index 3a032426778a..66dd7b05173b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/operations_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/operations_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OperationsGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/OperationsGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/operations_status_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/operations_status_get.py index 368603869e13..8aa2e306663b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/operations_status_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/operations_status_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OperationsStatusGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/OperationsStatusGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_delete.py index 7124a7bb26b7..bd4a2874495f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/OrderDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_get.py index d0f8f527f6ba..d938e5cb367b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/OrderGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_get_all_in_device.py index 4bc667ca3a6e..2d983ec34e00 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/OrderGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_put.py index 52964127d243..77b44c4613ba 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/order_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -56,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/OrderPut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/OrderPut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/put_addons.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/put_addons.py index 86c6e01fca21..5cb268606edb 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/put_addons.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/put_addons.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -47,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/PutAddons.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/PutAddons.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/put_monitoring_config.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/put_monitoring_config.py index 686388ef31a5..fc2204ccad2b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/put_monitoring_config.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/put_monitoring_config.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -49,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/PutMonitoringConfig.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/PutMonitoringConfig.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_delete.py index 393ff7aa9e7d..15e00fb7354b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RoleDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/RoleDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_get.py index 5a446315bf16..6bfac9293c26 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RoleGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/RoleGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_get_all_in_device.py index e635109071a7..834bed571a5d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RoleGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/RoleGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_list_add_ons.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_list_add_ons.py index 0cce563768c5..95dd4e636723 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_list_add_ons.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_list_add_ons.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential + from azure.mgmt.databoxedge import DataBoxEdgeManagementClient """ @@ -38,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/RoleListAddOns.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/RoleListAddOns.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_put.py index 5342d0784273..fcb0c9a5f3a3 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/role_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -72,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/RolePut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/RolePut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_delete.py index 36fd4dce06fe..f5a90b519774 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/SACDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_get.py index 2e9587fceb7b..83a164f8a86b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/SACGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_get_all_in_device.py index a8ea747686f9..239d466b62e7 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/SACGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_put.py index 5240c4483f6a..a50578c496fd 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/sac_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SACPut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/SACPut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/scan_for_updates_post.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/scan_for_updates_post.py index 4d283969393a..3b15b3851b89 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/scan_for_updates_post.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/scan_for_updates_post.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ScanForUpdatesPost.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ScanForUpdatesPost.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/security_settings_update_post.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/security_settings_update_post.py index 9d0267009fad..b1c9c30d16fe 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/security_settings_update_post.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/security_settings_update_post.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,14 +38,14 @@ def main(): "properties": { "deviceAdminPassword": { "encryptionAlgorithm": "AES256", - "encryptionCertThumbprint": "7DCBDFC44ED968D232C9A998FC105B5C70E84BE0", - "value": "", + "encryptionCertThumbprint": "", + "value": "", } } }, ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SecuritySettingsUpdatePost.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/SecuritySettingsUpdatePost.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_delete.py index 066af940c09b..92ecd291bb4f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ShareDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_get.py index 99b22686e593..103fcf755ecd 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ShareGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_get_all_in_device.py index 016f0cb37182..23c0c4e6bf9f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ShareGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_put.py index 5b2e5da8d571..cf5d998d71d6 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -58,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/SharePut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/SharePut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_refresh_post.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_refresh_post.py index 1e16d6c32e5c..2fe95a1bb710 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_refresh_post.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/share_refresh_post.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/ShareRefreshPost.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/ShareRefreshPost.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_delete.py index 49f112b625d8..5b1b6dffdaf5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/StorageAccountDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_get.py index 8c999ac1bf4d..8ebc4027a7d5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/StorageAccountGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_get_all_in_device.py index fc3b4c22b3e9..e4f5dadb23e0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/StorageAccountGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_put.py index 76e0295699dc..68d2892cbc5d 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/storage_account_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/StorageAccountPut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/StorageAccountPut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_delete.py index 98bfbb2a9a0f..017dc1ef4168 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/TriggerDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_get.py index 32f742e076bd..df3df2819fed 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/TriggerGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_get_all_in_device.py index e203257d2a72..c3a42ac30a26 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/TriggerGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_put.py index 501164e1b928..4dce3202a7ed 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -50,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/TriggerPut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/TriggerPut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_support_package.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_support_package.py deleted file mode 100644 index e07c83cd7a3e..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/trigger_support_package.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python trigger_support_package.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.support_packages.begin_trigger_support_package( - device_name="testedgedevice", - resource_group_name="GroupForEdgeAutomation", - trigger_support_package_request={ - "properties": { - "include": "DefaultWithDumps", - "maximumTimeStamp": "2018-12-18T02:19:51.4270267Z", - "minimumTimeStamp": "2018-12-18T02:18:51.4270267Z", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/TriggerSupportPackage.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_diagnostic_proactive_log_collection_settings.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_diagnostic_proactive_log_collection_settings.py deleted file mode 100644 index 6831ccca07a9..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_diagnostic_proactive_log_collection_settings.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python update_diagnostic_proactive_log_collection_settings.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.diagnostic_settings.begin_update_diagnostic_proactive_log_collection_settings( - device_name="testedgedevice", - resource_group_name="GroupForEdgeAutomation", - proactive_log_collection_settings={"properties": {"userConsent": "Enabled"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UpdateDiagnosticProactiveLogCollectionSettings.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_diagnostic_remote_support_settings.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_diagnostic_remote_support_settings.py deleted file mode 100644 index 7db1b9ec4077..000000000000 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_diagnostic_remote_support_settings.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential -from azure.mgmt.databoxedge import DataBoxEdgeManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-databoxedge -# USAGE - python update_diagnostic_remote_support_settings.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DataBoxEdgeManagementClient( - credential=DefaultAzureCredential(), - subscription_id="4385cf00-2d3a-425a-832f-f4285b1c9dce", - ) - - response = client.diagnostic_settings.begin_update_diagnostic_remote_support_settings( - device_name="testedgedevice", - resource_group_name="GroupForEdgeAutomation", - diagnostic_remote_support_settings={ - "properties": { - "remoteSupportSettingsList": [ - { - "accessLevel": "ReadWrite", - "expirationTimeStampInUTC": "2021-07-07T00:00:00+00:00", - "remoteApplicationType": "Powershell", - } - ] - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2022-03-01/examples/UpdateDiagnosticRemoteSupportSettings.json -if __name__ == "__main__": - main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_summary_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_summary_get.py index 92a282e9ab8c..fc55a14a3dfa 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_summary_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/update_summary_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UpdateSummaryGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/UpdateSummaryGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/upload_certificate_post.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/upload_certificate_post.py index 4b5f044781ec..2e99b4c4c55b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/upload_certificate_post.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/upload_certificate_post.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -42,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UploadCertificatePost.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/UploadCertificatePost.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_delete.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_delete.py index 0cf7661aa57e..7e9bf5e0cb90 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_delete.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserDelete.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/UserDelete.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_get.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_get.py index 278d6bbb5ab8..49c94ae747a7 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_get.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserGet.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/UserGet.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_get_all_in_device.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_get_all_in_device.py index e64d9f851d4c..45af16fc9cc7 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_get_all_in_device.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_get_all_in_device.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserGetAllInDevice.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/UserGetAllInDevice.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_put.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_put.py index 54efafdceef7..7e0997b53327 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_put.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_samples/user_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,7 +42,6 @@ def main(): "encryptionCertThumbprint": "blah", "value": "", }, - "shareAccessRights": [], "userType": "Share", } }, @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/stable/2019-08-01/examples/UserPut.json +# x-ms-original-file: specification/databoxedge/resource-manager/Microsoft.DataBoxEdge/preview/2021-02-01-preview/examples/UserPut.json if __name__ == "__main__": main() diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_addons_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_addons_operations.py new file mode 100644 index 000000000000..cfd1dd23c661 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_addons_operations.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.databoxedge import DataBoxEdgeManagementClient + +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 TestDataBoxEdgeManagementAddonsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxEdgeManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_addons_list_by_role(self, resource_group): + response = self.client.addons.list_by_role( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_addons_get(self, resource_group): + response = self.client.addons.get( + device_name="str", + role_name="str", + addon_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_addons_begin_create_or_update(self, resource_group): + response = self.client.addons.begin_create_or_update( + device_name="str", + role_name="str", + addon_name="str", + resource_group_name=resource_group.name, + addon={ + "kind": "ArcForKubernetes", + "resourceGroupName": "str", + "resourceLocation": "str", + "resourceName": "str", + "subscriptionId": "str", + "hostPlatform": "str", + "hostPlatformType": "str", + "id": "str", + "name": "str", + "provisioningState": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + "version": "str", + }, + api_version="2021-02-01-preview", + ).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_addons_begin_delete(self, resource_group): + response = self.client.addons.begin_delete( + device_name="str", + role_name="str", + addon_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_addons_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_addons_operations_async.py new file mode 100644 index 000000000000..4bcea58aa23d --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_addons_operations_async.py @@ -0,0 +1,101 @@ +# 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.databoxedge.aio import DataBoxEdgeManagementClient + +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 TestDataBoxEdgeManagementAddonsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxEdgeManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_addons_list_by_role(self, resource_group): + response = self.client.addons.list_by_role( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + 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_addons_get(self, resource_group): + response = await self.client.addons.get( + device_name="str", + role_name="str", + addon_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_addons_begin_create_or_update(self, resource_group): + response = await ( + await self.client.addons.begin_create_or_update( + device_name="str", + role_name="str", + addon_name="str", + resource_group_name=resource_group.name, + addon={ + "kind": "ArcForKubernetes", + "resourceGroupName": "str", + "resourceLocation": "str", + "resourceName": "str", + "subscriptionId": "str", + "hostPlatform": "str", + "hostPlatformType": "str", + "id": "str", + "name": "str", + "provisioningState": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + "version": "str", + }, + api_version="2021-02-01-preview", + ) + ).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_addons_begin_delete(self, resource_group): + response = await ( + await self.client.addons.begin_delete( + device_name="str", + role_name="str", + addon_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_alerts_operations.py index 15818378940e..6ae61d5c90aa 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_alerts_operations.py @@ -24,7 +24,7 @@ def test_alerts_list_by_data_box_edge_device(self, resource_group): response = self.client.alerts.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_alerts_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_alerts_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_alerts_operations_async.py index a65363cdad43..2e8eb77ad4cd 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_alerts_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_alerts_operations_async.py @@ -25,7 +25,7 @@ async def test_alerts_list_by_data_box_edge_device(self, resource_group): response = self.client.alerts.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_alerts_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_available_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_available_skus_operations.py new file mode 100644 index 000000000000..01a7bedaf8dc --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_available_skus_operations.py @@ -0,0 +1,29 @@ +# 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.databoxedge import DataBoxEdgeManagementClient + +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 TestDataBoxEdgeManagementAvailableSkusOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxEdgeManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_available_skus_list(self, resource_group): + response = self.client.available_skus.list( + api_version="2021-02-01-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_available_skus_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_available_skus_operations_async.py new file mode 100644 index 000000000000..63e1619be84b --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_available_skus_operations_async.py @@ -0,0 +1,30 @@ +# 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.databoxedge.aio import DataBoxEdgeManagementClient + +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 TestDataBoxEdgeManagementAvailableSkusOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxEdgeManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_available_skus_list(self, resource_group): + response = self.client.available_skus.list( + api_version="2021-02-01-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_bandwidth_schedules_operations.py index 282dd0ff8e5a..326edb43b6c0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_bandwidth_schedules_operations.py @@ -24,7 +24,7 @@ def test_bandwidth_schedules_list_by_data_box_edge_device(self, resource_group): response = self.client.bandwidth_schedules.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_bandwidth_schedules_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -57,9 +57,17 @@ def test_bandwidth_schedules_begin_create_or_update(self, resource_group): "stop": "str", "id": "str", "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,7 +80,7 @@ def test_bandwidth_schedules_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_bandwidth_schedules_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_bandwidth_schedules_operations_async.py index 68bb13160f0b..15ee1616ea5a 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_bandwidth_schedules_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_bandwidth_schedules_operations_async.py @@ -25,7 +25,7 @@ async def test_bandwidth_schedules_list_by_data_box_edge_device(self, resource_g response = self.client.bandwidth_schedules.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_bandwidth_schedules_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -59,9 +59,17 @@ async def test_bandwidth_schedules_begin_create_or_update(self, resource_group): "stop": "str", "id": "str", "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -76,7 +84,7 @@ async def test_bandwidth_schedules_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_containers_operations.py index 1c79bfef358b..4090e853527c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_containers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_containers_operations.py @@ -25,7 +25,7 @@ def test_containers_list_by_storage_account(self, resource_group): device_name="str", storage_account_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_containers_get(self, resource_group): storage_account_name="str", container_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -65,9 +65,17 @@ def test_containers_begin_create_or_update(self, resource_group): "lastCompletedRefreshJobTimeInUTC": "2020-02-20 00:00:00", "lastJob": "str", }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -81,7 +89,7 @@ def test_containers_begin_delete(self, resource_group): storage_account_name="str", container_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -95,7 +103,7 @@ def test_containers_begin_refresh(self, resource_group): storage_account_name="str", container_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_containers_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_containers_operations_async.py index 536e466d512c..bcb63a5593fa 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_containers_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_containers_operations_async.py @@ -26,7 +26,7 @@ async def test_containers_list_by_storage_account(self, resource_group): device_name="str", storage_account_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_containers_get(self, resource_group): storage_account_name="str", container_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -67,9 +67,17 @@ async def test_containers_begin_create_or_update(self, resource_group): "lastCompletedRefreshJobTimeInUTC": "2020-02-20 00:00:00", "lastJob": "str", }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -85,7 +93,7 @@ async def test_containers_begin_delete(self, resource_group): storage_account_name="str", container_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -101,7 +109,7 @@ async def test_containers_begin_refresh(self, resource_group): storage_account_name="str", container_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_devices_operations.py index 5d8772c749be..fc7465a96953 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_devices_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_devices_list_by_subscription(self, resource_group): response = self.client.devices.list_by_subscription( - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_devices_list_by_subscription(self, resource_group): def test_devices_list_by_resource_group(self, resource_group): response = self.client.devices.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_devices_get(self, resource_group): response = self.client.devices.get( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -68,19 +68,47 @@ def test_devices_begin_create_or_update(self, resource_group): "deviceModel": "str", "deviceSoftwareVersion": "str", "deviceType": "str", + "edgeProfile": { + "subscription": { + "id": "str", + "locationPlacementId": "str", + "quotaId": "str", + "registeredFeatures": [{"name": "str", "state": "str"}], + "registrationDate": "str", + "registrationId": "str", + "serializedDetails": "str", + "state": "str", + "subscriptionId": "str", + "tenantId": "str", + } + }, "etag": "str", "friendlyName": "str", "id": "str", + "identity": {"principalId": "str", "tenantId": "str", "type": "str"}, + "kind": "str", "modelDescription": "str", "name": "str", "nodeCount": 0, + "resourceMoveDetails": { + "operationInProgress": "str", + "operationInProgressLockTimeoutInUTC": "2020-02-20 00:00:00", + }, "serialNumber": "str", "sku": {"name": "str", "tier": "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"}, "timeZone": "str", "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -92,7 +120,7 @@ def test_devices_begin_delete(self, resource_group): response = self.client.devices.begin_delete( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -104,8 +132,12 @@ def test_devices_update(self, resource_group): response = self.client.devices.update( device_name="str", resource_group_name=resource_group.name, - parameters={"tags": {"str": "str"}}, - api_version="2019-08-01", + parameters={ + "edgeProfile": {"subscription": {"id": "str"}}, + "identity": {"principalId": "str", "tenantId": "str", "type": "str"}, + "tags": {"str": "str"}, + }, + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -117,19 +149,31 @@ def test_devices_begin_download_updates(self, resource_group): response = self.client.devices.begin_download_updates( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).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_devices_generate_certificate(self, resource_group): + response = self.client.devices.generate_certificate( + device_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_devices_get_extended_information(self, resource_group): response = self.client.devices.get_extended_information( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -141,7 +185,7 @@ def test_devices_begin_install_updates(self, resource_group): response = self.client.devices.begin_install_updates( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -153,7 +197,7 @@ def test_devices_get_network_settings(self, resource_group): response = self.client.devices.get_network_settings( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -165,7 +209,7 @@ def test_devices_begin_scan_for_updates(self, resource_group): response = self.client.devices.begin_scan_for_updates( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -187,19 +231,38 @@ def test_devices_begin_create_or_update_security_settings(self, resource_group): "name": "str", "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).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_devices_update_extended_information(self, resource_group): + response = self.client.devices.update_extended_information( + device_name="str", + resource_group_name=resource_group.name, + parameters={ + "channelIntegrityKeyName": "str", + "channelIntegrityKeyVersion": "str", + "clientSecretStoreId": "str", + "clientSecretStoreUrl": "str", + "syncStatus": "str", + }, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_devices_get_update_summary(self, resource_group): response = self.client.devices.get_update_summary( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -212,7 +275,7 @@ def test_devices_upload_certificate(self, resource_group): device_name="str", resource_group_name=resource_group.name, parameters={"certificate": "str", "authenticationType": "str"}, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_devices_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_devices_operations_async.py index f07004334cf6..f502e1ba424b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_devices_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_devices_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_devices_list_by_subscription(self, resource_group): response = self.client.devices.list_by_subscription( - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_devices_list_by_subscription(self, resource_group): async def test_devices_list_by_resource_group(self, resource_group): response = self.client.devices.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_devices_get(self, resource_group): response = await self.client.devices.get( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -70,19 +70,47 @@ async def test_devices_begin_create_or_update(self, resource_group): "deviceModel": "str", "deviceSoftwareVersion": "str", "deviceType": "str", + "edgeProfile": { + "subscription": { + "id": "str", + "locationPlacementId": "str", + "quotaId": "str", + "registeredFeatures": [{"name": "str", "state": "str"}], + "registrationDate": "str", + "registrationId": "str", + "serializedDetails": "str", + "state": "str", + "subscriptionId": "str", + "tenantId": "str", + } + }, "etag": "str", "friendlyName": "str", "id": "str", + "identity": {"principalId": "str", "tenantId": "str", "type": "str"}, + "kind": "str", "modelDescription": "str", "name": "str", "nodeCount": 0, + "resourceMoveDetails": { + "operationInProgress": "str", + "operationInProgressLockTimeoutInUTC": "2020-02-20 00:00:00", + }, "serialNumber": "str", "sku": {"name": "str", "tier": "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"}, "timeZone": "str", "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -96,7 +124,7 @@ async def test_devices_begin_delete(self, resource_group): await self.client.devices.begin_delete( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -109,8 +137,12 @@ async def test_devices_update(self, resource_group): response = await self.client.devices.update( device_name="str", resource_group_name=resource_group.name, - parameters={"tags": {"str": "str"}}, - api_version="2019-08-01", + parameters={ + "edgeProfile": {"subscription": {"id": "str"}}, + "identity": {"principalId": "str", "tenantId": "str", "type": "str"}, + "tags": {"str": "str"}, + }, + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -123,20 +155,32 @@ async def test_devices_begin_download_updates(self, resource_group): await self.client.devices.begin_download_updates( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).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_devices_generate_certificate(self, resource_group): + response = await self.client.devices.generate_certificate( + device_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_devices_get_extended_information(self, resource_group): response = await self.client.devices.get_extended_information( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -149,7 +193,7 @@ async def test_devices_begin_install_updates(self, resource_group): await self.client.devices.begin_install_updates( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -162,7 +206,7 @@ async def test_devices_get_network_settings(self, resource_group): response = await self.client.devices.get_network_settings( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -175,7 +219,7 @@ async def test_devices_begin_scan_for_updates(self, resource_group): await self.client.devices.begin_scan_for_updates( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -199,20 +243,39 @@ async def test_devices_begin_create_or_update_security_settings(self, resource_g "name": "str", "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).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_devices_update_extended_information(self, resource_group): + response = await self.client.devices.update_extended_information( + device_name="str", + resource_group_name=resource_group.name, + parameters={ + "channelIntegrityKeyName": "str", + "channelIntegrityKeyVersion": "str", + "clientSecretStoreId": "str", + "clientSecretStoreUrl": "str", + "syncStatus": "str", + }, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_devices_get_update_summary(self, resource_group): response = await self.client.devices.get_update_summary( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -225,7 +288,7 @@ async def test_devices_upload_certificate(self, resource_group): device_name="str", resource_group_name=resource_group.name, parameters={"certificate": "str", "authenticationType": "str"}, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_jobs_operations.py index 2ba24d85d0cd..3843feaa0d14 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_jobs_operations.py @@ -25,7 +25,7 @@ def test_jobs_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_jobs_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_jobs_operations_async.py index cfc764c1183a..e4495935b039 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_jobs_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_jobs_operations_async.py @@ -26,7 +26,7 @@ async def test_jobs_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_monitoring_config_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_monitoring_config_operations.py new file mode 100644 index 000000000000..c88e365b7047 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_monitoring_config_operations.py @@ -0,0 +1,103 @@ +# 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.databoxedge import DataBoxEdgeManagementClient + +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 TestDataBoxEdgeManagementMonitoringConfigOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxEdgeManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_monitoring_config_list(self, resource_group): + response = self.client.monitoring_config.list( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_monitoring_config_get(self, resource_group): + response = self.client.monitoring_config.get( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_monitoring_config_begin_create_or_update(self, resource_group): + response = self.client.monitoring_config.begin_create_or_update( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + monitoring_metric_configuration={ + "metricConfigurations": [ + { + "counterSets": [ + { + "counters": [ + { + "name": "str", + "additionalDimensions": [{"sourceName": "str", "sourceType": "str"}], + "dimensionFilter": [{"sourceName": "str", "sourceType": "str"}], + "instance": "str", + } + ] + } + ], + "resourceId": "str", + "mdmAccount": "str", + "metricNameSpace": "str", + } + ], + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2021-02-01-preview", + ).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_monitoring_config_begin_delete(self, resource_group): + response = self.client.monitoring_config.begin_delete( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_monitoring_config_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_monitoring_config_operations_async.py new file mode 100644 index 000000000000..56419fa324a3 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_monitoring_config_operations_async.py @@ -0,0 +1,108 @@ +# 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.databoxedge.aio import DataBoxEdgeManagementClient + +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 TestDataBoxEdgeManagementMonitoringConfigOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DataBoxEdgeManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_monitoring_config_list(self, resource_group): + response = self.client.monitoring_config.list( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + 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_monitoring_config_get(self, resource_group): + response = await self.client.monitoring_config.get( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_monitoring_config_begin_create_or_update(self, resource_group): + response = await ( + await self.client.monitoring_config.begin_create_or_update( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + monitoring_metric_configuration={ + "metricConfigurations": [ + { + "counterSets": [ + { + "counters": [ + { + "name": "str", + "additionalDimensions": [{"sourceName": "str", "sourceType": "str"}], + "dimensionFilter": [{"sourceName": "str", "sourceType": "str"}], + "instance": "str", + } + ] + } + ], + "resourceId": "str", + "mdmAccount": "str", + "metricNameSpace": "str", + } + ], + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2021-02-01-preview", + ) + ).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_monitoring_config_begin_delete(self, resource_group): + response = await ( + await self.client.monitoring_config.begin_delete( + device_name="str", + role_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_nodes_operations.py index e613483c68b1..9d2d1a6c7dda 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_nodes_operations.py @@ -24,7 +24,7 @@ def test_nodes_list_by_data_box_edge_device(self, resource_group): response = self.client.nodes.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_nodes_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_nodes_operations_async.py index bd0710400423..6248f7ad4705 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_nodes_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_nodes_operations_async.py @@ -25,7 +25,7 @@ async def test_nodes_list_by_data_box_edge_device(self, resource_group): response = self.client.nodes.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations.py index a1376940b605..58ea9c74001a 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_async.py index 7f152ad02f52..4e9907586219 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_status_operations.py index 0f27d3c3be87..439aaca986c1 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_status_operations.py @@ -25,7 +25,7 @@ def test_operations_status_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_status_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_status_operations_async.py index 9d40923b70a5..473fe2ed7201 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_status_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_operations_status_operations_async.py @@ -26,7 +26,7 @@ async def test_operations_status_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_orders_operations.py index f20078015683..ddfd9e49571c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_orders_operations.py @@ -24,7 +24,7 @@ def test_orders_list_by_data_box_edge_device(self, resource_group): response = self.client.orders.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -36,7 +36,7 @@ def test_orders_get(self, resource_group): response = self.client.orders.get( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -59,6 +59,12 @@ def test_orders_begin_create_or_update(self, resource_group): "status": "str", "additionalOrderDetails": {"str": "str"}, "comments": "str", + "trackingInformation": { + "carrierName": "str", + "serialNumber": "str", + "trackingId": "str", + "trackingUrl": "str", + }, "updateDateTime": "2020-02-20 00:00:00", }, "deliveryTrackingInfo": [ @@ -71,6 +77,12 @@ def test_orders_begin_create_or_update(self, resource_group): "status": "str", "additionalOrderDetails": {"str": "str"}, "comments": "str", + "trackingInformation": { + "carrierName": "str", + "serialNumber": "str", + "trackingId": "str", + "trackingUrl": "str", + }, "updateDateTime": "2020-02-20 00:00:00", } ], @@ -78,18 +90,27 @@ def test_orders_begin_create_or_update(self, resource_group): {"carrierName": "str", "serialNumber": "str", "trackingId": "str", "trackingUrl": "str"} ], "serialNumber": "str", + "shipmentType": "str", "shippingAddress": { + "country": "str", "addressLine1": "str", + "addressLine2": "str", + "addressLine3": "str", "city": "str", - "country": "str", "postalCode": "str", "state": "str", - "addressLine2": "str", - "addressLine3": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -101,8 +122,20 @@ def test_orders_begin_delete(self, resource_group): response = self.client.orders.begin_delete( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).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_orders_list_dc_access_code(self, resource_group): + response = self.client.orders.list_dc_access_code( + device_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_orders_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_orders_operations_async.py index 4651d10b8077..c9f19785eba5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_orders_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_orders_operations_async.py @@ -25,7 +25,7 @@ async def test_orders_list_by_data_box_edge_device(self, resource_group): response = self.client.orders.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ async def test_orders_get(self, resource_group): response = await self.client.orders.get( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -61,6 +61,12 @@ async def test_orders_begin_create_or_update(self, resource_group): "status": "str", "additionalOrderDetails": {"str": "str"}, "comments": "str", + "trackingInformation": { + "carrierName": "str", + "serialNumber": "str", + "trackingId": "str", + "trackingUrl": "str", + }, "updateDateTime": "2020-02-20 00:00:00", }, "deliveryTrackingInfo": [ @@ -73,6 +79,12 @@ async def test_orders_begin_create_or_update(self, resource_group): "status": "str", "additionalOrderDetails": {"str": "str"}, "comments": "str", + "trackingInformation": { + "carrierName": "str", + "serialNumber": "str", + "trackingId": "str", + "trackingUrl": "str", + }, "updateDateTime": "2020-02-20 00:00:00", } ], @@ -80,18 +92,27 @@ async def test_orders_begin_create_or_update(self, resource_group): {"carrierName": "str", "serialNumber": "str", "trackingId": "str", "trackingUrl": "str"} ], "serialNumber": "str", + "shipmentType": "str", "shippingAddress": { + "country": "str", "addressLine1": "str", + "addressLine2": "str", + "addressLine3": "str", "city": "str", - "country": "str", "postalCode": "str", "state": "str", - "addressLine2": "str", - "addressLine3": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -105,9 +126,21 @@ async def test_orders_begin_delete(self, resource_group): await self.client.orders.begin_delete( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).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_orders_list_dc_access_code(self, resource_group): + response = await self.client.orders.list_dc_access_code( + device_name="str", + resource_group_name=resource_group.name, + api_version="2021-02-01-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_roles_operations.py index ea0c9a4283dc..bf665dea0679 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_roles_operations.py @@ -24,7 +24,7 @@ def test_roles_list_by_data_box_edge_device(self, resource_group): response = self.client.roles.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_roles_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -51,43 +51,36 @@ def test_roles_begin_create_or_update(self, resource_group): name="str", resource_group_name=resource_group.name, role={ - "kind": "IOT", - "hostPlatform": "str", - "id": "str", - "ioTDeviceDetails": { - "deviceId": "str", - "ioTHostHub": "str", - "authentication": { - "symmetricKey": { - "connectionString": { - "encryptionAlgorithm": "str", - "value": "str", - "encryptionCertThumbprint": "str", - } - } - }, - "ioTHostHubId": "str", - }, - "ioTEdgeDeviceDetails": { - "deviceId": "str", - "ioTHostHub": "str", - "authentication": { - "symmetricKey": { - "connectionString": { - "encryptionAlgorithm": "str", - "value": "str", - "encryptionCertThumbprint": "str", - } - } - }, - "ioTHostHubId": "str", + "kind": "CloudEdgeManagement", + "edgeProfile": { + "subscription": { + "id": "str", + "locationPlacementId": "str", + "quotaId": "str", + "registeredFeatures": [{"name": "str", "state": "str"}], + "registrationDate": "str", + "registrationId": "str", + "serializedDetails": "str", + "state": "str", + "subscriptionId": "str", + "tenantId": "str", + } }, + "id": "str", + "localManagementStatus": "str", "name": "str", "roleStatus": "str", - "shareMappings": [{"shareId": "str", "mountPoint": "str", "roleId": "str", "roleType": "str"}], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -100,7 +93,7 @@ def test_roles_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_roles_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_roles_operations_async.py index 4f9b7dfa8ca8..ab6759f031e5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_roles_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_roles_operations_async.py @@ -25,7 +25,7 @@ async def test_roles_list_by_data_box_edge_device(self, resource_group): response = self.client.roles.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_roles_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -53,43 +53,36 @@ async def test_roles_begin_create_or_update(self, resource_group): name="str", resource_group_name=resource_group.name, role={ - "kind": "IOT", - "hostPlatform": "str", - "id": "str", - "ioTDeviceDetails": { - "deviceId": "str", - "ioTHostHub": "str", - "authentication": { - "symmetricKey": { - "connectionString": { - "encryptionAlgorithm": "str", - "value": "str", - "encryptionCertThumbprint": "str", - } - } - }, - "ioTHostHubId": "str", - }, - "ioTEdgeDeviceDetails": { - "deviceId": "str", - "ioTHostHub": "str", - "authentication": { - "symmetricKey": { - "connectionString": { - "encryptionAlgorithm": "str", - "value": "str", - "encryptionCertThumbprint": "str", - } - } - }, - "ioTHostHubId": "str", + "kind": "CloudEdgeManagement", + "edgeProfile": { + "subscription": { + "id": "str", + "locationPlacementId": "str", + "quotaId": "str", + "registeredFeatures": [{"name": "str", "state": "str"}], + "registrationDate": "str", + "registrationId": "str", + "serializedDetails": "str", + "state": "str", + "subscriptionId": "str", + "tenantId": "str", + } }, + "id": "str", + "localManagementStatus": "str", "name": "str", "roleStatus": "str", - "shareMappings": [{"shareId": "str", "mountPoint": "str", "roleId": "str", "roleType": "str"}], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +97,7 @@ async def test_roles_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_shares_operations.py index 740c3f8081d0..b96df3aa3728 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_shares_operations.py @@ -24,7 +24,7 @@ def test_shares_list_by_data_box_edge_device(self, resource_group): response = self.client.shares.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_shares_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -70,11 +70,21 @@ def test_shares_begin_create_or_update(self, resource_group): "lastCompletedRefreshJobTimeInUTC": "2020-02-20 00:00:00", "lastJob": "str", }, - "shareMappings": [{"shareId": "str", "mountPoint": "str", "roleId": "str", "roleType": "str"}], + "shareMappings": [ + {"shareId": "str", "mountPoint": "str", "mountType": "str", "roleId": "str", "roleType": "str"} + ], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", "userAccessRights": [{"accessType": "str", "userId": "str"}], }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -87,7 +97,7 @@ def test_shares_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -100,7 +110,7 @@ def test_shares_begin_refresh(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_shares_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_shares_operations_async.py index 49dd4b4bcaf0..34e2b5bfdcc0 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_shares_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_shares_operations_async.py @@ -25,7 +25,7 @@ async def test_shares_list_by_data_box_edge_device(self, resource_group): response = self.client.shares.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_shares_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -72,11 +72,21 @@ async def test_shares_begin_create_or_update(self, resource_group): "lastCompletedRefreshJobTimeInUTC": "2020-02-20 00:00:00", "lastJob": "str", }, - "shareMappings": [{"shareId": "str", "mountPoint": "str", "roleId": "str", "roleType": "str"}], + "shareMappings": [ + {"shareId": "str", "mountPoint": "str", "mountType": "str", "roleId": "str", "roleType": "str"} + ], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", "userAccessRights": [{"accessType": "str", "userId": "str"}], }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -91,7 +101,7 @@ async def test_shares_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -106,7 +116,7 @@ async def test_shares_begin_refresh(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_account_credentials_operations.py index 6d277fcbb517..dec4916f98c8 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_account_credentials_operations.py @@ -24,7 +24,7 @@ def test_storage_account_credentials_list_by_data_box_edge_device(self, resource response = self.client.storage_account_credentials.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_storage_account_credentials_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -60,10 +60,18 @@ def test_storage_account_credentials_begin_create_or_update(self, resource_group "id": "str", "name": "str", "storageAccountId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", "userName": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -76,7 +84,7 @@ def test_storage_account_credentials_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_account_credentials_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_account_credentials_operations_async.py index 8a1f80eaf5b6..70510d72e2f4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_account_credentials_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_account_credentials_operations_async.py @@ -25,7 +25,7 @@ async def test_storage_account_credentials_list_by_data_box_edge_device(self, re response = self.client.storage_account_credentials.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_storage_account_credentials_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -62,10 +62,18 @@ async def test_storage_account_credentials_begin_create_or_update(self, resource "id": "str", "name": "str", "storageAccountId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", "userName": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -80,7 +88,7 @@ async def test_storage_account_credentials_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_accounts_operations.py index 3ca7c0eb5125..b14cc6fee774 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_accounts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_accounts_operations.py @@ -24,7 +24,7 @@ def test_storage_accounts_list_by_data_box_edge_device(self, resource_group): response = self.client.storage_accounts.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_storage_accounts_get(self, resource_group): device_name="str", storage_account_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -51,17 +51,25 @@ def test_storage_accounts_begin_create_or_update(self, resource_group): storage_account_name="str", resource_group_name=resource_group.name, storage_account={ + "dataPolicy": "str", "blobEndpoint": "str", "containerCount": 0, - "dataPolicy": "str", "description": "str", "id": "str", "name": "str", "storageAccountCredentialId": "str", "storageAccountStatus": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,7 +82,7 @@ def test_storage_accounts_begin_delete(self, resource_group): device_name="str", storage_account_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_accounts_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_accounts_operations_async.py index db4e8810fe09..0dece12dced9 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_accounts_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_storage_accounts_operations_async.py @@ -25,7 +25,7 @@ async def test_storage_accounts_list_by_data_box_edge_device(self, resource_grou response = self.client.storage_accounts.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_storage_accounts_get(self, resource_group): device_name="str", storage_account_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -53,17 +53,25 @@ async def test_storage_accounts_begin_create_or_update(self, resource_group): storage_account_name="str", resource_group_name=resource_group.name, storage_account={ + "dataPolicy": "str", "blobEndpoint": "str", "containerCount": 0, - "dataPolicy": "str", "description": "str", "id": "str", "name": "str", "storageAccountCredentialId": "str", "storageAccountStatus": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -78,7 +86,7 @@ async def test_storage_accounts_begin_delete(self, resource_group): device_name="str", storage_account_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_triggers_operations.py index 24dd6c1c1c8f..03dbe80460c4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_triggers_operations.py @@ -24,7 +24,7 @@ def test_triggers_list_by_data_box_edge_device(self, resource_group): response = self.client.triggers.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_triggers_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -57,9 +57,17 @@ def test_triggers_begin_create_or_update(self, resource_group): "customContextTag": "str", "id": "str", "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,7 +80,7 @@ def test_triggers_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_triggers_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_triggers_operations_async.py index 17eeb982881f..b235518075a5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_triggers_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_triggers_operations_async.py @@ -25,7 +25,7 @@ async def test_triggers_list_by_data_box_edge_device(self, resource_group): response = self.client.triggers.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_triggers_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -59,9 +59,17 @@ async def test_triggers_begin_create_or_update(self, resource_group): "customContextTag": "str", "id": "str", "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -76,7 +84,7 @@ async def test_triggers_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_users_operations.py index df55d874f6d5..5197d2978916 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_users_operations.py @@ -24,7 +24,7 @@ def test_users_list_by_data_box_edge_device(self, resource_group): response = self.client.users.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_users_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -51,14 +51,22 @@ def test_users_begin_create_or_update(self, resource_group): name="str", resource_group_name=resource_group.name, user={ - "userType": "str", "encryptedPassword": {"encryptionAlgorithm": "str", "value": "str", "encryptionCertThumbprint": "str"}, "id": "str", "name": "str", "shareAccessRights": [{"accessType": "str", "shareId": "str"}], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", + "userType": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -71,7 +79,7 @@ def test_users_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_users_operations_async.py b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_users_operations_async.py index 913ed8ac1ac8..a1b381481de2 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_users_operations_async.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/generated_tests/test_data_box_edge_management_users_operations_async.py @@ -25,7 +25,7 @@ async def test_users_list_by_data_box_edge_device(self, resource_group): response = self.client.users.list_by_data_box_edge_device( device_name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_users_get(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) # please add some check logic here by yourself @@ -53,7 +53,6 @@ async def test_users_begin_create_or_update(self, resource_group): name="str", resource_group_name=resource_group.name, user={ - "userType": "str", "encryptedPassword": { "encryptionAlgorithm": "str", "value": "str", @@ -62,9 +61,18 @@ async def test_users_begin_create_or_update(self, resource_group): "id": "str", "name": "str", "shareAccessRights": [{"accessType": "str", "shareId": "str"}], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", + "userType": "str", }, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -79,7 +87,7 @@ async def test_users_begin_delete(self, resource_group): device_name="str", name="str", resource_group_name=resource_group.name, - api_version="2019-08-01", + api_version="2021-02-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/sdk_packaging.toml b/sdk/databoxedge/azure-mgmt-databoxedge/sdk_packaging.toml index bebb0d7c1370..21c6239682e5 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/sdk_packaging.toml +++ b/sdk/databoxedge/azure-mgmt-databoxedge/sdk_packaging.toml @@ -3,6 +3,6 @@ package_name = "azure-mgmt-databoxedge" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Data Box Edge Management" package_doc_id = "" -is_stable = true +is_stable = false is_arm = true title = "DataBoxEdgeManagementClient" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/setup.py b/sdk/databoxedge/azure-mgmt-databoxedge/setup.py index a6a59081ad38..f411bbf0f0c1 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/setup.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/setup.py @@ -49,11 +49,10 @@ url="https://github.com/Azure/azure-sdk-for-python", keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product classifiers=[ - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "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", @@ -77,7 +76,7 @@ "isodate>=0.6.1", "typing-extensions>=4.6.0", "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", + "azure-mgmt-core>=1.5.0", ], - python_requires=">=3.8", + python_requires=">=3.9", ) From 441af18d41dcacfaaded3a3179e4610a52dd8f7e Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Fri, 4 Jul 2025 15:13:15 +0800 Subject: [PATCH 2/3] Update CHANGELOG.md --- sdk/databoxedge/azure-mgmt-databoxedge/CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/CHANGELOG.md b/sdk/databoxedge/azure-mgmt-databoxedge/CHANGELOG.md index fd6056a9cacc..b820d1432970 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/CHANGELOG.md +++ b/sdk/databoxedge/azure-mgmt-databoxedge/CHANGELOG.md @@ -1,8 +1,6 @@ # Release History -## 0.0.0(it should be perview) (2025-07-21) - - +## 3.0.0b1 (2025-07-21) ## 2.0.0 (2025-02-19) From 36c3fec02c251b8f7ad2573cec66b3b4f8a2d3d1 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Fri, 4 Jul 2025 15:13:51 +0800 Subject: [PATCH 3/3] Update _version.py --- .../azure-mgmt-databoxedge/azure/mgmt/databoxedge/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_version.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_version.py index fb6c13e9c00f..3dd4685104d4 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_version.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "0.0.0" +VERSION = "3.0.0b1"