From 9050d75e9af4012d5cf97b4953942348a3e7a32c Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 4 Jul 2025 11:07:23 +0000 Subject: [PATCH 1/2] code and test --- .../azure-mgmt-servicebus/CHANGELOG.md | 4 + .../azure-mgmt-servicebus/MANIFEST.in | 1 - .../azure-mgmt-servicebus/_meta.json | 19 - .../azure-mgmt-servicebus/_metadata.json | 11 + .../azure/mgmt/servicebus/__init__.py | 26 +- .../azure/mgmt/servicebus/_configuration.py | 59 +- .../servicebus/{v2021_11_01 => }/_patch.py | 9 +- .../_service_bus_management_client.py | 347 +- .../_version.py => _utils/__init__.py} | 3 - .../serialization.py} | 7 + .../azure/mgmt/servicebus/_version.py | 2 +- .../azure/mgmt/servicebus/aio/__init__.py | 23 +- .../mgmt/servicebus/aio/_configuration.py | 59 +- .../{v2021_11_01/models => aio}/_patch.py | 9 +- .../aio/_service_bus_management_client.py | 351 +- .../aio/operations/__init__.py | 0 .../_disaster_recovery_configs_operations.py | 87 +- .../_migration_configs_operations.py | 54 +- .../aio/operations/_namespaces_operations.py | 143 +- .../aio/operations/_operations.py | 16 +- .../aio/operations/_patch.py | 9 +- ...private_endpoint_connections_operations.py | 36 +- .../_private_link_resources_operations.py | 9 +- .../aio/operations/_queues_operations.py | 77 +- .../aio/operations/_rules_operations.py | 33 +- .../operations/_subscriptions_operations.py | 34 +- .../aio/operations/_topics_operations.py | 77 +- .../azure/mgmt/servicebus/models.py | 7 - .../models/__init__.py | 0 .../models/_models_py3.py | 279 +- .../{v2021_11_01/aio => models}/_patch.py | 9 +- .../_service_bus_management_client_enums.py | 0 .../{v2021_11_01 => }/operations/__init__.py | 0 .../_disaster_recovery_configs_operations.py | 111 +- .../_migration_configs_operations.py | 72 +- .../operations/_namespaces_operations.py | 172 +- .../operations/_operations.py | 19 +- .../mgmt/servicebus/operations/_patch.py | 21 + ...private_endpoint_connections_operations.py | 47 +- .../_private_link_resources_operations.py | 13 +- .../operations/_queues_operations.py | 99 +- .../operations/_rules_operations.py | 43 +- .../operations/_subscriptions_operations.py | 43 +- .../operations/_topics_operations.py | 99 +- .../mgmt/servicebus/v2021_11_01/__init__.py | 32 - .../servicebus/v2021_11_01/_configuration.py | 65 - .../servicebus/v2021_11_01/_metadata.json | 119 - .../_service_bus_management_client.py | 170 - .../servicebus/v2021_11_01/aio/__init__.py | 29 - .../v2021_11_01/aio/_configuration.py | 65 - .../aio/_service_bus_management_client.py | 175 - .../servicebus/v2021_11_01/models/__init__.py | 174 - .../v2021_11_01/models/_models_py3.py | 3046 ----------------- .../_service_bus_management_client_enums.py | 157 - .../v2021_11_01/operations/_patch.py | 20 - .../mgmt/servicebus/v2021_11_01/py.typed | 1 - .../v2022_10_01_preview/__init__.py | 32 - .../v2022_10_01_preview/_configuration.py | 65 - .../v2022_10_01_preview/_metadata.json | 119 - .../servicebus/v2022_10_01_preview/_patch.py | 20 - .../_service_bus_management_client.py | 179 - .../v2022_10_01_preview/_version.py | 9 - .../v2022_10_01_preview/aio/__init__.py | 29 - .../v2022_10_01_preview/aio/_configuration.py | 65 - .../v2022_10_01_preview/aio/_patch.py | 20 - .../aio/_service_bus_management_client.py | 184 - .../aio/operations/__init__.py | 43 - .../_disaster_recovery_configs_operations.py | 975 ------ .../_migration_configs_operations.py | 632 ---- .../aio/operations/_namespaces_operations.py | 1718 ---------- .../aio/operations/_operations.py | 134 - .../aio/operations/_patch.py | 20 - ...private_endpoint_connections_operations.py | 492 --- .../_private_link_resources_operations.py | 117 - .../aio/operations/_queues_operations.py | 1066 ------ .../aio/operations/_rules_operations.py | 476 --- .../operations/_subscriptions_operations.py | 462 --- .../aio/operations/_topics_operations.py | 1075 ------ .../v2022_10_01_preview/models/_patch.py | 20 - .../operations/__init__.py | 43 - .../_disaster_recovery_configs_operations.py | 1333 -------- .../_migration_configs_operations.py | 852 ----- .../operations/_namespaces_operations.py | 2242 ------------ .../operations/_operations.py | 155 - .../v2022_10_01_preview/operations/_patch.py | 20 - ...private_endpoint_connections_operations.py | 644 ---- .../_private_link_resources_operations.py | 153 - .../operations/_queues_operations.py | 1453 -------- .../operations/_rules_operations.py | 648 ---- .../operations/_subscriptions_operations.py | 627 ---- .../operations/_topics_operations.py | 1462 -------- .../servicebus/v2022_10_01_preview/py.typed | 1 - .../sb_alias_authorization_rule_get.py | 2 +- .../sb_alias_authorization_rule_list_all.py | 2 +- .../sb_alias_authorization_rule_list_key.py | 2 +- .../sb_alias_check_name_availability.py | 2 +- .../sb_alias_create.py | 2 +- .../sb_alias_delete.py | 2 +- .../sb_alias_fail_over.py | 2 +- .../disaster_recovery_configs/sb_alias_get.py | 2 +- .../sb_alias_list.py | 2 +- .../sbeh_alias_break_pairing.py | 2 +- ...grationconfiguration_complete_migration.py | 2 +- ...onfiguration_create_and_start_migration.py | 2 +- .../sb_migrationconfiguration_delete.py | 2 +- .../sb_migrationconfiguration_get.py | 2 +- .../sb_migrationconfiguration_list.py | 2 +- .../sb_migrationconfiguration_revert.py | 2 +- .../private_end_point_connection_create.py | 2 +- .../private_end_point_connection_delete.py | 4 +- .../private_end_point_connection_get.py | 2 +- .../private_end_point_connection_list.py | 2 +- .../name_spaces/private_link_resources_get.py | 2 +- ...sb_name_space_authorization_rule_create.py | 2 +- ...sb_name_space_authorization_rule_delete.py | 2 +- .../sb_name_space_authorization_rule_get.py | 2 +- ..._name_space_authorization_rule_list_all.py | 2 +- ..._name_space_authorization_rule_list_key.py | 2 +- ...space_authorization_rule_regenerate_key.py | 2 +- .../sb_name_space_check_name_availability.py | 2 +- .../name_spaces/sb_name_space_create.py | 5 +- .../name_spaces/sb_name_space_delete.py | 4 +- .../name_spaces/sb_name_space_get.py | 2 +- .../name_spaces/sb_name_space_list.py | 2 +- .../sb_name_space_list_by_resource_group.py | 2 +- .../name_spaces/sb_name_space_update.py | 2 +- .../sb_network_rule_set_create.py | 2 +- .../sb_network_rule_set_get.py | 2 +- .../sb_network_rule_set_list.py | 2 +- .../private_end_point_connection_create.py | 51 - .../private_end_point_connection_delete.py | 42 - .../private_end_point_connection_get.py | 42 - .../private_end_point_connection_list.py | 42 - .../private_link_resources_get.py | 41 - .../sb_queue_authorization_rule_create.py | 2 +- .../sb_queue_authorization_rule_delete.py | 2 +- .../queues/sb_queue_authorization_rule_get.py | 2 +- .../sb_queue_authorization_rule_list_all.py | 2 +- .../sb_queue_authorization_rule_list_key.py | 2 +- ...queue_authorization_rule_regenerate_key.py | 2 +- .../queues/sb_queue_create.py | 2 +- .../queues/sb_queue_delete.py | 2 +- .../generated_samples/queues/sb_queue_get.py | 2 +- .../queues/sb_queue_list_by_name_space.py | 2 +- .../rule_create_correlation_filter.py | 50 - .../rule_create_sql_filter.py | 45 - .../generated_samples/rule_delete.py | 44 - .../generated_samples/rule_get.py | 44 - .../rule_list_by_subscription.py | 44 - .../rules/rule_create_correlation_filter.py | 2 +- .../rules/rule_create_sql_filter.py | 2 +- .../generated_samples/rules/rule_delete.py | 2 +- .../generated_samples/rules/rule_get.py | 2 +- .../rules/rule_list_by_subscription.py | 2 +- .../sb_alias_authorization_rule_get.py | 43 - .../sb_alias_authorization_rule_list_all.py | 43 - .../sb_alias_authorization_rule_list_key.py | 43 - .../sb_alias_check_name_availability.py | 42 - .../generated_samples/sb_alias_create.py | 45 - .../generated_samples/sb_alias_delete.py | 42 - .../generated_samples/sb_alias_fail_over.py | 42 - .../generated_samples/sb_alias_get.py | 42 - .../generated_samples/sb_alias_list.py | 42 - ...grationconfiguration_complete_migration.py | 42 - ...onfiguration_create_and_start_migration.py | 48 - .../sb_migrationconfiguration_delete.py | 42 - .../sb_migrationconfiguration_get.py | 42 - .../sb_migrationconfiguration_list.py | 42 - .../sb_migrationconfiguration_revert.py | 42 - ...sb_name_space_authorization_rule_create.py | 43 - ...sb_name_space_authorization_rule_delete.py | 42 - .../sb_name_space_authorization_rule_get.py | 42 - ..._name_space_authorization_rule_list_all.py | 42 - ..._name_space_authorization_rule_list_key.py | 42 - ...space_authorization_rule_regenerate_key.py | 43 - .../sb_name_space_check_name_availability.py | 40 - .../generated_samples/sb_name_space_create.py | 46 - .../generated_samples/sb_name_space_delete.py | 41 - .../generated_samples/sb_name_space_get.py | 41 - .../generated_samples/sb_name_space_list.py | 39 - .../sb_name_space_list_by_resource_group.py | 41 - .../generated_samples/sb_name_space_update.py | 42 - .../sb_network_rule_set_create.py | 73 - .../sb_network_rule_set_get.py | 41 - .../sb_network_rule_set_list.py | 42 - .../generated_samples/sb_operations_list.py | 2 +- .../sb_queue_authorization_rule_create.py | 44 - .../sb_queue_authorization_rule_delete.py | 43 - .../sb_queue_authorization_rule_get.py | 43 - .../sb_queue_authorization_rule_list_all.py | 43 - .../sb_queue_authorization_rule_list_key.py | 43 - ...queue_authorization_rule_regenerate_key.py | 44 - .../generated_samples/sb_queue_create.py | 43 - .../generated_samples/sb_queue_delete.py | 42 - .../generated_samples/sb_queue_get.py | 42 - .../sb_queue_list_by_name_space.py | 42 - .../sb_subscription_create.py | 44 - .../sb_subscription_delete.py | 43 - .../generated_samples/sb_subscription_get.py | 43 - .../sb_subscription_list_by_topic.py | 43 - .../sb_topic_authorization_rule_create.py | 44 - .../sb_topic_authorization_rule_delete.py | 43 - .../sb_topic_authorization_rule_get.py | 43 - .../sb_topic_authorization_rule_list_all.py | 43 - .../sb_topic_authorization_rule_list_key.py | 43 - ...topic_authorization_rule_regenerate_key.py | 44 - .../generated_samples/sb_topic_create.py | 43 - .../generated_samples/sb_topic_delete.py | 42 - .../generated_samples/sb_topic_get.py | 42 - .../sb_topic_list_by_name_space.py | 42 - .../sbeh_alias_break_pairing.py | 42 - .../subscriptions/sb_subscription_create.py | 2 +- .../subscriptions/sb_subscription_delete.py | 2 +- .../subscriptions/sb_subscription_get.py | 2 +- .../sb_subscription_list_by_topic.py | 2 +- .../sb_topic_authorization_rule_create.py | 2 +- .../sb_topic_authorization_rule_delete.py | 2 +- .../topics/sb_topic_authorization_rule_get.py | 2 +- .../sb_topic_authorization_rule_list_all.py | 2 +- .../sb_topic_authorization_rule_list_key.py | 2 +- ...topic_authorization_rule_regenerate_key.py | 2 +- .../topics/sb_topic_create.py | 2 +- .../topics/sb_topic_delete.py | 2 +- .../generated_samples/topics/sb_topic_get.py | 2 +- .../topics/sb_topic_list_by_name_space.py | 2 +- ...nt_disaster_recovery_configs_operations.py | 22 +- ...aster_recovery_configs_operations_async.py | 22 +- ...management_migration_configs_operations.py | 14 +- ...ment_migration_configs_operations_async.py | 14 +- ...ce_bus_management_namespaces_operations.py | 37 +- ..._management_namespaces_operations_async.py | 37 +- .../test_service_bus_management_operations.py | 4 +- ...service_bus_management_operations_async.py | 4 +- ...private_endpoint_connections_operations.py | 10 +- ...e_endpoint_connections_operations_async.py | 10 +- ...ement_private_link_resources_operations.py | 4 +- ...private_link_resources_operations_async.py | 4 +- ...ervice_bus_management_queues_operations.py | 22 +- ..._bus_management_queues_operations_async.py | 22 +- ...service_bus_management_rules_operations.py | 10 +- ...e_bus_management_rules_operations_async.py | 10 +- ...bus_management_subscriptions_operations.py | 10 +- ...nagement_subscriptions_operations_async.py | 10 +- ...ervice_bus_management_topics_operations.py | 22 +- ..._bus_management_topics_operations_async.py | 22 +- .../azure-mgmt-servicebus/sdk_packaging.toml | 2 +- sdk/servicebus/azure-mgmt-servicebus/setup.py | 2 +- 247 files changed, 1340 insertions(+), 26152 deletions(-) delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/_meta.json create mode 100644 sdk/servicebus/azure-mgmt-servicebus/_metadata.json rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/_patch.py (61%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01/_version.py => _utils/__init__.py} (93%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{_serialization.py => _utils/serialization.py} (99%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01/models => aio}/_patch.py (61%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/__init__.py (100%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_disaster_recovery_configs_operations.py (92%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_migration_configs_operations.py (92%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_namespaces_operations.py (93%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_operations.py (89%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_patch.py (61%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_private_endpoint_connections_operations.py (93%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_private_link_resources_operations.py (92%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_queues_operations.py (94%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_rules_operations.py (94%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_subscriptions_operations.py (93%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/aio/operations/_topics_operations.py (94%) delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models.py rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2022_10_01_preview => }/models/__init__.py (100%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2022_10_01_preview => }/models/_models_py3.py (91%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01/aio => models}/_patch.py (61%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2022_10_01_preview => }/models/_service_bus_management_client_enums.py (100%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/__init__.py (100%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_disaster_recovery_configs_operations.py (93%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_migration_configs_operations.py (93%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_namespaces_operations.py (94%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_operations.py (90%) create mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_patch.py rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_private_endpoint_connections_operations.py (94%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_private_link_resources_operations.py (93%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_queues_operations.py (95%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_rules_operations.py (95%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_subscriptions_operations.py (95%) rename sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/{v2021_11_01 => }/operations/_topics_operations.py (95%) delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/__init__.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_configuration.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_metadata.json delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_service_bus_management_client.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/__init__.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_configuration.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_service_bus_management_client.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/__init__.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_models_py3.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_service_bus_management_client_enums.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_patch.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/py.typed delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/__init__.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_configuration.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_metadata.json delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_patch.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_service_bus_management_client.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_version.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/__init__.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_configuration.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_patch.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_service_bus_management_client.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/__init__.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_disaster_recovery_configs_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_migration_configs_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_namespaces_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_patch.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_queues_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_rules_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_subscriptions_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_topics_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/_patch.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/__init__.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_disaster_recovery_configs_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_migration_configs_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_namespaces_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_patch.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_private_link_resources_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_queues_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_rules_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_subscriptions_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_topics_operations.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/py.typed delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_list.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_link_resources_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_create_correlation_filter.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_create_sql_filter.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_list_by_subscription.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_list_all.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_list_key.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_check_name_availability.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_fail_over.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_list.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_complete_migration.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_create_and_start_migration.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_list.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_revert.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_list_all.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_list_key.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_regenerate_key.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_check_name_availability.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_list.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_list_by_resource_group.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_update.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_list.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_list_all.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_list_key.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_regenerate_key.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_list_by_name_space.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_list_by_topic.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_list_all.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_list_key.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_regenerate_key.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_create.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_delete.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_get.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_list_by_name_space.py delete mode 100644 sdk/servicebus/azure-mgmt-servicebus/generated_samples/sbeh_alias_break_pairing.py diff --git a/sdk/servicebus/azure-mgmt-servicebus/CHANGELOG.md b/sdk/servicebus/azure-mgmt-servicebus/CHANGELOG.md index d585e1d0cd9b..5be369937c61 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-mgmt-servicebus/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 0.0.0(it should be perview) (2025-07-21) + + + ## 9.0.0 (2025-04-22) ### Breaking Changes diff --git a/sdk/servicebus/azure-mgmt-servicebus/MANIFEST.in b/sdk/servicebus/azure-mgmt-servicebus/MANIFEST.in index 28983897258e..e25554302e59 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/MANIFEST.in +++ b/sdk/servicebus/azure-mgmt-servicebus/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/servicebus/azure-mgmt-servicebus/_meta.json b/sdk/servicebus/azure-mgmt-servicebus/_meta.json deleted file mode 100644 index 2fbc54c6fc3a..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/_meta.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "commit": "d2457f3dae10d48a6a74d867b335d96b229b2b03", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.33.0", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/servicebus/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.33.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/servicebus/resource-manager/readme.md", - "package-2022-10-preview": "2023-04-13 07:43:12 +0530 9bc5a13776661d0bc699efadece14870e2846d7f Microsoft.ServiceBus/preview/2022-10-01-preview/migrationconfigs.json", - "package-2022-01-preview": "2023-04-13 07:43:12 +0530 9bc5a13776661d0bc699efadece14870e2846d7f Microsoft.ServiceBus/preview/2022-01-01-preview/migrationconfigs.json", - "package-2021-11": "2022-06-05 19:46:58 -0700 2d6cb29af754f48a08f94cb6113bb1f01a4e0eb9 Microsoft.ServiceBus/stable/2021-11-01/namespace-preview.json", - "package-2021-06-preview": "2021-08-31 00:27:06 -0700 09fe30cc6703f65e479f54115b5d714f78de6c19 Microsoft.ServiceBus/preview/2021-06-01-preview/topics.json", - "package-2021-01-preview": "2021-05-25 00:36:37 -0700 216931dc4ec175664bbe8222f9ea5ea3def69106 Microsoft.ServiceBus/preview/2021-01-01-preview/namespace-preview.json", - "package-2018-01-preview": "2021-05-25 00:36:37 -0700 216931dc4ec175664bbe8222f9ea5ea3def69106 Microsoft.ServiceBus/preview/2018-01-01-preview/namespace-preview.json", - "package-2017-04": "2021-03-25 10:47:57 +0800 e4c056151df3c59bbb2221e23f623fdb625313c5 Microsoft.ServiceBus/stable/2017-04-01/Rules.json", - "package-2015-08": "2019-06-12 19:26:02 -0400 8024b7e11a19c823d835ae05ec00769eaa10b057 Microsoft.ServiceBus/stable/2015-08-01/servicebus.json" -} \ No newline at end of file diff --git a/sdk/servicebus/azure-mgmt-servicebus/_metadata.json b/sdk/servicebus/azure-mgmt-servicebus/_metadata.json new file mode 100644 index 000000000000..18bba8af2ba6 --- /dev/null +++ b/sdk/servicebus/azure-mgmt-servicebus/_metadata.json @@ -0,0 +1,11 @@ +{ + "commit": "d6be9c2ee1911fb1684512336ba0c8271fa37551", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest": "3.10.2", + "use": [ + "@autorest/python@6.35.0", + "@autorest/modelerfour@4.27.0" + ], + "autorest_command": "autorest specification/servicebus/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-2022-10-preview --use=@autorest/python@6.35.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "readme": "specification/servicebus/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/__init__.py index d3e8cda5f049..d4f6b2f73883 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/__init__.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/__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 ._service_bus_management_client import ServiceBusManagementClient -__all__ = ['ServiceBusManagementClient'] +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 ._service_bus_management_client import ServiceBusManagementClient # 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__ = [ + "ServiceBusManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_configuration.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_configuration.py index d4a7c9a73b2f..603089ae43fc 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_configuration.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_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 ServiceBusManagementClientConfiguration: + +class ServiceBusManagementClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ServiceBusManagementClient. Note that all parameters used to create this instance are saved as instance @@ -27,16 +25,17 @@ class ServiceBusManagementClientConfiguration: :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-10-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", "2022-10-01-preview") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -44,23 +43,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-servicebus/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-servicebus/{}".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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_patch.py similarity index 61% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_patch.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_patch.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_service_bus_management_client.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_service_bus_management_client.py index 29da28eaae53..5660f5c57104 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_service_bus_management_client.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_service_bus_management_client.py @@ -1,89 +1,94 @@ # coding=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 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.mgmt.core.tools import get_arm_endpoints -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin +from . import models as _models from ._configuration import ServiceBusManagementClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer +from .operations import ( + DisasterRecoveryConfigsOperations, + MigrationConfigsOperations, + NamespacesOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QueuesOperations, + RulesOperations, + SubscriptionsOperations, + TopicsOperations, +) 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 implementation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass -class ServiceBusManagementClient(MultiApiClientMixin, _SDKClient): +class ServiceBusManagementClient: # pylint: disable=too-many-instance-attributes """Azure Service Bus client for managing Namespace. - 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. - + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: azure.mgmt.servicebus.operations.NamespacesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.servicebus.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.servicebus.operations.PrivateLinkResourcesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.servicebus.operations.Operations + :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations + :vartype disaster_recovery_configs: + azure.mgmt.servicebus.operations.DisasterRecoveryConfigsOperations + :ivar migration_configs: MigrationConfigsOperations operations + :vartype migration_configs: azure.mgmt.servicebus.operations.MigrationConfigsOperations + :ivar queues: QueuesOperations operations + :vartype queues: azure.mgmt.servicebus.operations.QueuesOperations + :ivar topics: TopicsOperations operations + :vartype topics: azure.mgmt.servicebus.operations.TopicsOperations + :ivar rules: RulesOperations operations + :vartype rules: azure.mgmt.servicebus.operations.RulesOperations + :ivar subscriptions: SubscriptionsOperations operations + :vartype subscriptions: azure.mgmt.servicebus.operations.SubscriptionsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. 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 "2022-10-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 = '2021-11-01' - _PROFILE_TAG = "azure.mgmt.servicebus.ServiceBusManagementClient" - 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: Optional[str] = None, - profile: KnownProfiles=KnownProfiles.default, - **kwargs: Any - ): - if api_version: - kwargs.setdefault('api_version', api_version) + 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 = ServiceBusManagementClientConfiguration(credential, subscription_id, credential_scopes=credential_scopes, **kwargs) + self._config = ServiceBusManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs + ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -103,204 +108,58 @@ def __init__( self._config.http_logging_policy, ] self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) - super(ServiceBusManagementClient, self).__init__( - api_version=api_version, - profile=profile - ) - - @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: - - * 2021-11-01: :mod:`v2021_11_01.models` - * 2022-10-01-preview: :mod:`v2022_10_01_preview.models` - """ - if api_version == '2021-11-01': - from .v2021_11_01 import models - return models - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def disaster_recovery_configs(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`DisasterRecoveryConfigsOperations` - * 2022-10-01-preview: :class:`DisasterRecoveryConfigsOperations` - """ - api_version = self._get_api_version('disaster_recovery_configs') - if api_version == '2021-11-01': - from .v2021_11_01.operations import DisasterRecoveryConfigsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import DisasterRecoveryConfigsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'disaster_recovery_configs'".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 migration_configs(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`MigrationConfigsOperations` - * 2022-10-01-preview: :class:`MigrationConfigsOperations` - """ - api_version = self._get_api_version('migration_configs') - if api_version == '2021-11-01': - from .v2021_11_01.operations import MigrationConfigsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import MigrationConfigsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'migration_configs'".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 namespaces(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`NamespacesOperations` - * 2022-10-01-preview: :class:`NamespacesOperations` - """ - api_version = self._get_api_version('namespaces') - if api_version == '2021-11-01': - from .v2021_11_01.operations import NamespacesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import NamespacesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'namespaces'".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: - - * 2021-11-01: :class:`Operations` - * 2022-10-01-preview: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2021-11-01': - from .v2021_11_01.operations import Operations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_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 private_endpoint_connections(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`PrivateEndpointConnectionsOperations` - * 2022-10-01-preview: :class:`PrivateEndpointConnectionsOperations` - """ - api_version = self._get_api_version('private_endpoint_connections') - if api_version == '2021-11-01': - from .v2021_11_01.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".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 private_link_resources(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`PrivateLinkResourcesOperations` - * 2022-10-01-preview: :class:`PrivateLinkResourcesOperations` - """ - api_version = self._get_api_version('private_link_resources') - if api_version == '2021-11-01': - from .v2021_11_01.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import PrivateLinkResourcesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_link_resources'".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 queues(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`QueuesOperations` - * 2022-10-01-preview: :class:`QueuesOperations` - """ - api_version = self._get_api_version('queues') - if api_version == '2021-11-01': - from .v2021_11_01.operations import QueuesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import QueuesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'queues'".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 rules(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`RulesOperations` - * 2022-10-01-preview: :class:`RulesOperations` - """ - api_version = self._get_api_version('rules') - if api_version == '2021-11-01': - from .v2021_11_01.operations import RulesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import RulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'rules'".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 subscriptions(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`SubscriptionsOperations` - * 2022-10-01-preview: :class:`SubscriptionsOperations` + 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.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.migration_configs = MigrationConfigsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.queues = QueuesOperations(self._client, self._config, self._serialize, self._deserialize) + self.topics = TopicsOperations(self._client, self._config, self._serialize, self._deserialize) + self.rules = RulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse """ - api_version = self._get_api_version('subscriptions') - if api_version == '2021-11-01': - from .v2021_11_01.operations import SubscriptionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import SubscriptionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'subscriptions'".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 topics(self): - """Instance depends on the API version: - * 2021-11-01: :class:`TopicsOperations` - * 2022-10-01-preview: :class:`TopicsOperations` - """ - api_version = self._get_api_version('topics') - if api_version == '2021-11-01': - from .v2021_11_01.operations import TopicsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from .v2022_10_01_preview.operations import TopicsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'topics'".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) + 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): + 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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_version.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_utils/__init__.py similarity index 93% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_version.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_utils/__init__.py index b77ac9246082..0af9b28f6607 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_version.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_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 = "9.0.0" diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_serialization.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_utils/serialization.py similarity index 99% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_serialization.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_utils/serialization.py index 05bcd7d403ae..f5187701d7be 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_serialization.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_utils/serialization.py @@ -1,4 +1,11 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_version.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_version.py index b77ac9246082..9bd4c9b55137 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_version.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "9.0.0" +VERSION = "0.0.0" diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/__init__.py index 9016cbc21795..39948e536385 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/__init__.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/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 ._service_bus_management_client import ServiceBusManagementClient -__all__ = ['ServiceBusManagementClient'] +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._service_bus_management_client import ServiceBusManagementClient # 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__ = [ + "ServiceBusManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/_configuration.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/_configuration.py index dc7a778c8d92..8d0a955e908f 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/_configuration.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/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 ServiceBusManagementClientConfiguration: + +class ServiceBusManagementClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ServiceBusManagementClient. Note that all parameters used to create this instance are saved as instance @@ -27,16 +25,17 @@ class ServiceBusManagementClientConfiguration: :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-10-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", "2022-10-01-preview") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -44,23 +43,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-servicebus/{}'.format(VERSION)) + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-servicebus/{}".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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/_patch.py similarity index 61% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_patch.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_patch.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/_service_bus_management_client.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/_service_bus_management_client.py index 6a293ed6db18..bcbf847d37cf 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/_service_bus_management_client.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/_service_bus_management_client.py @@ -1,89 +1,94 @@ # coding=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, cast +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.mgmt.core.tools import get_arm_endpoints -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin -from .._serialization import Deserializer, Serializer +from .. import models as _models +from .._utils.serialization import Deserializer, Serializer from ._configuration import ServiceBusManagementClientConfiguration +from .operations import ( + DisasterRecoveryConfigsOperations, + MigrationConfigsOperations, + NamespacesOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + QueuesOperations, + RulesOperations, + SubscriptionsOperations, + TopicsOperations, +) 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 implementation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass -class ServiceBusManagementClient(MultiApiClientMixin, _SDKClient): +class ServiceBusManagementClient: # pylint: disable=too-many-instance-attributes """Azure Service Bus client for managing Namespace. - 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. - + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: azure.mgmt.servicebus.aio.operations.NamespacesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.servicebus.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.servicebus.aio.operations.PrivateLinkResourcesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.servicebus.aio.operations.Operations + :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations + :vartype disaster_recovery_configs: + azure.mgmt.servicebus.aio.operations.DisasterRecoveryConfigsOperations + :ivar migration_configs: MigrationConfigsOperations operations + :vartype migration_configs: azure.mgmt.servicebus.aio.operations.MigrationConfigsOperations + :ivar queues: QueuesOperations operations + :vartype queues: azure.mgmt.servicebus.aio.operations.QueuesOperations + :ivar topics: TopicsOperations operations + :vartype topics: azure.mgmt.servicebus.aio.operations.TopicsOperations + :ivar rules: RulesOperations operations + :vartype rules: azure.mgmt.servicebus.aio.operations.RulesOperations + :ivar subscriptions: SubscriptionsOperations operations + :vartype subscriptions: azure.mgmt.servicebus.aio.operations.SubscriptionsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. + :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. 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 "2022-10-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 = '2021-11-01' - _PROFILE_TAG = "azure.mgmt.servicebus.ServiceBusManagementClient" - 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: Optional[str] = None, - 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) _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 = ServiceBusManagementClientConfiguration(credential, subscription_id, credential_scopes=credential_scopes, **kwargs) + self._config = ServiceBusManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs + ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -102,205 +107,63 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) - super(ServiceBusManagementClient, 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: - - * 2021-11-01: :mod:`v2021_11_01.models` - * 2022-10-01-preview: :mod:`v2022_10_01_preview.models` - """ - if api_version == '2021-11-01': - from ..v2021_11_01 import models - return models - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def disaster_recovery_configs(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`DisasterRecoveryConfigsOperations` - * 2022-10-01-preview: :class:`DisasterRecoveryConfigsOperations` - """ - api_version = self._get_api_version('disaster_recovery_configs') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import DisasterRecoveryConfigsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import DisasterRecoveryConfigsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'disaster_recovery_configs'".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 migration_configs(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`MigrationConfigsOperations` - * 2022-10-01-preview: :class:`MigrationConfigsOperations` - """ - api_version = self._get_api_version('migration_configs') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import MigrationConfigsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import MigrationConfigsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'migration_configs'".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 namespaces(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`NamespacesOperations` - * 2022-10-01-preview: :class:`NamespacesOperations` - """ - api_version = self._get_api_version('namespaces') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import NamespacesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import NamespacesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'namespaces'".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: - - * 2021-11-01: :class:`Operations` - * 2022-10-01-preview: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import Operations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_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 private_endpoint_connections(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`PrivateEndpointConnectionsOperations` - * 2022-10-01-preview: :class:`PrivateEndpointConnectionsOperations` - """ - api_version = self._get_api_version('private_endpoint_connections') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".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 private_link_resources(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`PrivateLinkResourcesOperations` - * 2022-10-01-preview: :class:`PrivateLinkResourcesOperations` - """ - api_version = self._get_api_version('private_link_resources') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import PrivateLinkResourcesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_link_resources'".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 queues(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`QueuesOperations` - * 2022-10-01-preview: :class:`QueuesOperations` - """ - api_version = self._get_api_version('queues') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import QueuesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import QueuesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'queues'".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 rules(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`RulesOperations` - * 2022-10-01-preview: :class:`RulesOperations` - """ - api_version = self._get_api_version('rules') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import RulesOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import RulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'rules'".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 subscriptions(self): - """Instance depends on the API version: - - * 2021-11-01: :class:`SubscriptionsOperations` - * 2022-10-01-preview: :class:`SubscriptionsOperations` + 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.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.migration_configs = MigrationConfigsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.queues = QueuesOperations(self._client, self._config, self._serialize, self._deserialize) + self.topics = TopicsOperations(self._client, self._config, self._serialize, self._deserialize) + self.rules = RulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) + + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse """ - api_version = self._get_api_version('subscriptions') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import SubscriptionsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import SubscriptionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'subscriptions'".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 topics(self): - """Instance depends on the API version: - * 2021-11-01: :class:`TopicsOperations` - * 2022-10-01-preview: :class:`TopicsOperations` - """ - api_version = self._get_api_version('topics') - if api_version == '2021-11-01': - from ..v2021_11_01.aio.operations import TopicsOperations as OperationClass - elif api_version == '2022-10-01-preview': - from ..v2022_10_01_preview.aio.operations import TopicsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'topics'".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) + 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): + 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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/__init__.py similarity index 100% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/__init__.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/__init__.py diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_disaster_recovery_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_disaster_recovery_configs_operations.py similarity index 92% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_disaster_recovery_configs_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_disaster_recovery_configs_operations.py index 53101bf71f72..a7648b49a2a8 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_disaster_recovery_configs_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_disaster_recovery_configs_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -28,7 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._disaster_recovery_configs_operations import ( build_break_pairing_request, build_check_name_availability_request, @@ -53,7 +53,7 @@ class DisasterRecoveryConfigsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`disaster_recovery_configs` attribute. """ @@ -67,12 +67,11 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ArmDisasterRecovery"]: + ) -> AsyncItemPaged["_models.ArmDisasterRecovery"]: """Gets all Alias(Disaster Recovery configurations). :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -81,13 +80,13 @@ def list( :type namespace_name: str :return: An iterator like instance of either ArmDisasterRecovery or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.ArmDisasterRecovery] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ArmDisasterRecoveryListResult] = 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 ) @@ -163,7 +162,7 @@ async def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Optional[_models.ArmDisasterRecovery]: + ) -> _models.ArmDisasterRecovery: """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -174,12 +173,12 @@ async def create_or_update( :type alias: str :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery + :type parameters: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: ArmDisasterRecovery or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery or None + :return: ArmDisasterRecovery or the result of cls(response) + :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :raises ~azure.core.exceptions.HttpResponseError: """ @@ -193,7 +192,7 @@ async def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Optional[_models.ArmDisasterRecovery]: + ) -> _models.ArmDisasterRecovery: """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -208,8 +207,8 @@ async def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: ArmDisasterRecovery or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery or None + :return: ArmDisasterRecovery or the result of cls(response) + :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :raises ~azure.core.exceptions.HttpResponseError: """ @@ -221,7 +220,7 @@ async def create_or_update( alias: str, parameters: Union[_models.ArmDisasterRecovery, IO[bytes]], **kwargs: Any - ) -> Optional[_models.ArmDisasterRecovery]: + ) -> _models.ArmDisasterRecovery: """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -232,9 +231,9 @@ async def create_or_update( :type alias: str :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Is either a ArmDisasterRecovery type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery or IO[bytes] - :return: ArmDisasterRecovery or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery or None + :type parameters: ~azure.mgmt.servicebus.models.ArmDisasterRecovery or IO[bytes] + :return: ArmDisasterRecovery or the result of cls(response) + :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -248,9 +247,9 @@ async def create_or_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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.ArmDisasterRecovery]] = kwargs.pop("cls", None) + cls: ClsType[_models.ArmDisasterRecovery] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -286,9 +285,7 @@ async def create_or_update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("ArmDisasterRecovery", pipeline_response.http_response) + deserialized = self._deserialize("ArmDisasterRecovery", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -320,7 +317,7 @@ async def delete(self, resource_group_name: str, namespace_name: str, alias: 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -362,7 +359,7 @@ async def get( :param alias: The Disaster Recovery configuration name. Required. :type alias: str :return: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery + :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -376,7 +373,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ArmDisasterRecovery] = kwargs.pop("cls", None) _request = build_get_request( @@ -435,7 +432,7 @@ async def break_pairing(self, resource_group_name: str, namespace_name: str, ali _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_break_pairing_request( @@ -485,7 +482,7 @@ async def fail_over( :type alias: str :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Default value is None. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.FailoverProperties + :type parameters: ~azure.mgmt.servicebus.models.FailoverProperties :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -543,7 +540,7 @@ async def fail_over( :type alias: str :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Is either a FailoverProperties type or a IO[bytes] type. Default value is None. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.FailoverProperties or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.FailoverProperties or IO[bytes] :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -559,7 +556,7 @@ async def fail_over( _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -606,7 +603,7 @@ async def fail_over( @distributed_trace def list_authorization_rules( self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any - ) -> AsyncIterable["_models.SBAuthorizationRule"]: + ) -> AsyncItemPaged["_models.SBAuthorizationRule"]: """Gets the authorization rules for a namespace. .. seealso:: @@ -620,13 +617,13 @@ def list_authorization_rules( :type alias: str :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -660,7 +657,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 ) @@ -711,7 +708,7 @@ async def get_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -725,7 +722,7 @@ async def get_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) _request = build_get_authorization_rule_request( @@ -777,7 +774,7 @@ async def list_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -791,7 +788,7 @@ async def list_keys( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) _request = build_list_keys_request( @@ -842,12 +839,12 @@ async def check_name_availability( :param namespace_name: The namespace name. Required. :type namespace_name: str :param parameters: Parameters to check availability of the given namespace name. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailability + :type parameters: ~azure.mgmt.servicebus.models.CheckNameAvailability :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -873,7 +870,7 @@ async def check_name_availability( Default value is "application/json". :paramtype content_type: str :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -893,9 +890,9 @@ async def check_name_availability( :type namespace_name: str :param parameters: Parameters to check availability of the given namespace name. Is either a CheckNameAvailability type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailability or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.CheckNameAvailability or IO[bytes] :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -909,7 +906,7 @@ async def check_name_availability( _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-11-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.CheckNameAvailabilityResult] = kwargs.pop("cls", None) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_migration_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_migration_configs_operations.py similarity index 92% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_migration_configs_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_migration_configs_operations.py index 0dedde84c7f0..aaa4c43964f2 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_migration_configs_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_migration_configs_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -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 @@ -32,7 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._migration_configs_operations import ( build_complete_migration_request, build_create_and_start_migration_request, @@ -53,7 +53,7 @@ class MigrationConfigsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`migration_configs` attribute. """ @@ -67,12 +67,11 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.MigrationConfigProperties"]: + ) -> AsyncItemPaged["_models.MigrationConfigProperties"]: """Gets all migrationConfigurations. :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -82,13 +81,13 @@ def list( :return: An iterator like instance of either MigrationConfigProperties or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.MigrationConfigProperties] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MigrationConfigListResult] = 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 ) @@ -173,7 +172,7 @@ async def _create_and_start_migration_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-11-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) @@ -242,16 +241,16 @@ async def begin_create_and_start_migration( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :param parameters: Parameters required to create Migration Configuration. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties + :type parameters: ~azure.mgmt.servicebus.models.MigrationConfigProperties :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 MigrationConfigProperties or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.models.MigrationConfigProperties] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -274,7 +273,7 @@ async def begin_create_and_start_migration( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :param parameters: Parameters required to create Migration Configuration. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -283,7 +282,7 @@ async def begin_create_and_start_migration( :return: An instance of AsyncLROPoller that returns either MigrationConfigProperties or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.models.MigrationConfigProperties] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -304,21 +303,20 @@ async def begin_create_and_start_migration( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :param parameters: Parameters required to create Migration Configuration. Is either a MigrationConfigProperties type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.MigrationConfigProperties or IO[bytes] :return: An instance of AsyncLROPoller that returns either MigrationConfigProperties or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.models.MigrationConfigProperties] :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-11-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.MigrationConfigProperties] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -378,7 +376,7 @@ async def delete( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -394,7 +392,7 @@ async def 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -438,9 +436,9 @@ async def get( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :return: MigrationConfigProperties or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties + :rtype: ~azure.mgmt.servicebus.models.MigrationConfigProperties :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -454,7 +452,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MigrationConfigProperties] = kwargs.pop("cls", None) _request = build_get_request( @@ -504,7 +502,7 @@ async def complete_migration( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -520,7 +518,7 @@ async def complete_migration( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_complete_migration_request( @@ -564,7 +562,7 @@ async def revert( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -580,7 +578,7 @@ async def revert( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_revert_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_namespaces_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_namespaces_operations.py similarity index 93% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_namespaces_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_namespaces_operations.py index f441f40855c8..5d55563b4979 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_namespaces_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_namespaces_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -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 @@ -33,7 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._namespaces_operations import ( build_check_name_availability_request, build_create_or_update_authorization_rule_request, @@ -64,7 +64,7 @@ class NamespacesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`namespaces` attribute. """ @@ -78,24 +78,22 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.SBNamespace"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.SBNamespace"]: """Gets all the available namespaces within the subscription, irrespective of the resource groups. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639412.aspx :return: An iterator like instance of either SBNamespace or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.SBNamespace] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBNamespaceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -126,7 +124,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 +158,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.SBNamespace"]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.SBNamespace"]: """Gets the available namespaces within a resource group. .. seealso:: @@ -169,14 +167,13 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy :param resource_group_name: Name of the Resource group within the Azure subscription. Required. :type resource_group_name: str :return: An iterator like instance of either SBNamespace or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.SBNamespace] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBNamespaceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -208,7 +205,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 +256,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-11-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) @@ -329,14 +326,13 @@ async def begin_create_or_update( :param namespace_name: The namespace name. Required. :type namespace_name: str :param parameters: Parameters supplied to create a namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace + :type parameters: ~azure.mgmt.servicebus.models.SBNamespace :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 SBNamespace or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.models.SBNamespace] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -367,8 +363,7 @@ async def begin_create_or_update( :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either SBNamespace or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.models.SBNamespace] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -392,17 +387,16 @@ async def begin_create_or_update( :type namespace_name: str :param parameters: Parameters supplied to create a namespace resource. Is either a SBNamespace type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBNamespace or IO[bytes] :return: An instance of AsyncLROPoller that returns either SBNamespace or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.models.SBNamespace] :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-11-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.SBNamespace] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -460,7 +454,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-11-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( @@ -516,7 +510,7 @@ async def begin_delete(self, resource_group_name: str, namespace_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-11-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) @@ -565,7 +559,7 @@ async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any :param namespace_name: The namespace name. Required. :type namespace_name: str :return: SBNamespace or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace + :rtype: ~azure.mgmt.servicebus.models.SBNamespace :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -579,7 +573,7 @@ async def get(self, resource_group_name: str, namespace_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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBNamespace] = kwargs.pop("cls", None) _request = build_get_request( @@ -629,12 +623,12 @@ async def update( :param namespace_name: The namespace name. Required. :type namespace_name: str :param parameters: Parameters supplied to update a namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespaceUpdateParameters + :type parameters: ~azure.mgmt.servicebus.models.SBNamespaceUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace or None + :rtype: ~azure.mgmt.servicebus.models.SBNamespace or None :raises ~azure.core.exceptions.HttpResponseError: """ @@ -661,7 +655,7 @@ async def update( Default value is "application/json". :paramtype content_type: str :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace or None + :rtype: ~azure.mgmt.servicebus.models.SBNamespace or None :raises ~azure.core.exceptions.HttpResponseError: """ @@ -682,10 +676,9 @@ async def update( :type namespace_name: str :param parameters: Parameters supplied to update a namespace resource. Is either a SBNamespaceUpdateParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespaceUpdateParameters or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBNamespaceUpdateParameters or IO[bytes] :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace or None + :rtype: ~azure.mgmt.servicebus.models.SBNamespace or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -699,7 +692,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SBNamespace]] = kwargs.pop("cls", None) @@ -761,12 +754,12 @@ async def create_or_update_network_rule_set( :param namespace_name: The namespace name. Required. :type namespace_name: str :param parameters: The Namespace IpFilterRule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :type parameters: ~azure.mgmt.servicebus.models.NetworkRuleSet :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet :raises ~azure.core.exceptions.HttpResponseError: """ @@ -792,7 +785,7 @@ async def create_or_update_network_rule_set( Default value is "application/json". :paramtype content_type: str :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet :raises ~azure.core.exceptions.HttpResponseError: """ @@ -812,9 +805,9 @@ async def create_or_update_network_rule_set( :type namespace_name: str :param parameters: The Namespace IpFilterRule. Is either a NetworkRuleSet type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.NetworkRuleSet or IO[bytes] :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -828,7 +821,7 @@ async def create_or_update_network_rule_set( _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-11-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.NetworkRuleSet] = kwargs.pop("cls", None) @@ -883,7 +876,7 @@ async def get_network_rule_set( :param namespace_name: The namespace name. Required. :type namespace_name: str :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -897,7 +890,7 @@ async def get_network_rule_set( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetworkRuleSet] = kwargs.pop("cls", None) _request = build_get_network_rule_set_request( @@ -932,7 +925,7 @@ async def get_network_rule_set( @distributed_trace def list_network_rule_sets( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NetworkRuleSet"]: + ) -> AsyncItemPaged["_models.NetworkRuleSet"]: """Gets list of NetworkRuleSet for a Namespace. :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -940,14 +933,13 @@ def list_network_rule_sets( :param namespace_name: The namespace name. Required. :type namespace_name: str :return: An iterator like instance of either NetworkRuleSet or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.NetworkRuleSet] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetworkRuleSetListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -980,7 +972,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 ) @@ -1016,7 +1008,7 @@ async def get_next(next_link=None): @distributed_trace def list_authorization_rules( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SBAuthorizationRule"]: + ) -> AsyncItemPaged["_models.SBAuthorizationRule"]: """Gets the authorization rules for a namespace. .. seealso:: @@ -1028,13 +1020,13 @@ def list_authorization_rules( :type namespace_name: str :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1067,7 +1059,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 ) @@ -1123,12 +1115,12 @@ async def create_or_update_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1160,7 +1152,7 @@ async def create_or_update_authorization_rule( Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1186,9 +1178,9 @@ async def create_or_update_authorization_rule( :type authorization_rule_name: str :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule or IO[bytes] :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1202,7 +1194,7 @@ async def create_or_update_authorization_rule( _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-11-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.SBAuthorizationRule] = kwargs.pop("cls", None) @@ -1277,7 +1269,7 @@ async def delete_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_authorization_rule_request( @@ -1322,7 +1314,7 @@ async def get_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1336,7 +1328,7 @@ async def get_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) _request = build_get_authorization_rule_request( @@ -1385,7 +1377,7 @@ async def list_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1399,7 +1391,7 @@ async def list_keys( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) _request = build_list_keys_request( @@ -1455,12 +1447,12 @@ async def regenerate_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1492,7 +1484,7 @@ async def regenerate_keys( Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1518,10 +1510,9 @@ async def regenerate_keys( :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Is either a RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters or IO[bytes] :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1535,7 +1526,7 @@ async def regenerate_keys( _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-11-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.AccessKeys] = kwargs.pop("cls", None) @@ -1587,12 +1578,12 @@ async def check_name_availability( """Check the give namespace name availability. :param parameters: Parameters to check availability of the given namespace name. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailability + :type parameters: ~azure.mgmt.servicebus.models.CheckNameAvailability :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1608,7 +1599,7 @@ async def check_name_availability( Default value is "application/json". :paramtype content_type: str :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1620,9 +1611,9 @@ async def check_name_availability( :param parameters: Parameters to check availability of the given namespace name. Is either a CheckNameAvailability type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailability or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.CheckNameAvailability or IO[bytes] :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1636,7 +1627,7 @@ async def check_name_availability( _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-11-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.CheckNameAvailabilityResult] = kwargs.pop("cls", None) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_operations.py similarity index 89% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_operations.py index d558180ae14d..fd5b1731333b 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import AsyncPipelineClient @@ -26,7 +26,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import build_list_request from .._configuration import ServiceBusManagementClientConfiguration @@ -40,7 +40,7 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`operations` attribute. """ @@ -54,21 +54,19 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - 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"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """Lists all of the available ServiceBus REST API operations. :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.Operation] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -98,7 +96,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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_patch.py similarity index 61% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_patch.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_patch.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_private_endpoint_connections_operations.py similarity index 93% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_private_endpoint_connections_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_private_endpoint_connections_operations.py index 02f5aada58b9..fdee35434557 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -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 @@ -32,7 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_endpoint_connections_operations import ( build_create_or_update_request, build_delete_request, @@ -51,7 +51,7 @@ class PrivateEndpointConnectionsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`private_endpoint_connections` attribute. """ @@ -65,12 +65,11 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnection"]: + ) -> AsyncItemPaged["_models.PrivateEndpointConnection"]: """Gets the available PrivateEndpointConnections within a namespace. .. seealso:: @@ -83,13 +82,13 @@ def list( :return: An iterator like instance of either PrivateEndpointConnection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.PrivateEndpointConnection] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -122,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 ) @@ -179,12 +178,12 @@ async def create_or_update( :type private_endpoint_connection_name: str :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :type parameters: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -217,7 +216,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -243,10 +242,9 @@ async def create_or_update( :type private_endpoint_connection_name: str :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.PrivateEndpointConnection or IO[bytes] :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -260,7 +258,7 @@ async def create_or_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-11-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.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -319,7 +317,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-11-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( @@ -379,7 +377,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-11-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) @@ -433,7 +431,7 @@ async def get( :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. :type private_endpoint_connection_name: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -447,7 +445,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_private_link_resources_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_private_link_resources_operations.py similarity index 92% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_private_link_resources_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_private_link_resources_operations.py index 68e7be6bc7b2..7785d9144b6d 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_private_link_resources_operations.py @@ -24,7 +24,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_link_resources_operations import build_get_request from .._configuration import ServiceBusManagementClientConfiguration @@ -38,7 +38,7 @@ class PrivateLinkResourcesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`private_link_resources` attribute. """ @@ -52,7 +52,6 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get( @@ -68,7 +67,7 @@ async def get( :param namespace_name: The namespace name. Required. :type namespace_name: str :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateLinkResourcesListResult + :rtype: ~azure.mgmt.servicebus.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -82,7 +81,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_queues_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_queues_operations.py similarity index 94% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_queues_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_queues_operations.py index d430ffe55f6e..5e78e70205a4 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_queues_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_queues_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -29,7 +29,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._queues_operations import ( build_create_or_update_authorization_rule_request, build_create_or_update_request, @@ -54,7 +54,7 @@ class QueuesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`queues` attribute. """ @@ -68,12 +68,11 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_authorization_rules( self, resource_group_name: str, namespace_name: str, queue_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SBAuthorizationRule"]: + ) -> AsyncItemPaged["_models.SBAuthorizationRule"]: """Gets all authorization rules for a queue. .. seealso:: @@ -87,13 +86,13 @@ def list_authorization_rules( :type queue_name: str :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -127,7 +126,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 ) @@ -183,12 +182,12 @@ async def create_or_update_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -220,7 +219,7 @@ async def create_or_update_authorization_rule( Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -246,9 +245,9 @@ async def create_or_update_authorization_rule( :type authorization_rule_name: str :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule or IO[bytes] :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -262,7 +261,7 @@ async def create_or_update_authorization_rule( _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-11-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.SBAuthorizationRule] = kwargs.pop("cls", None) @@ -345,7 +344,7 @@ async def delete_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_authorization_rule_request( @@ -398,7 +397,7 @@ async def get_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -412,7 +411,7 @@ async def get_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) _request = build_get_authorization_rule_request( @@ -469,7 +468,7 @@ async def list_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -483,7 +482,7 @@ async def list_keys( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) _request = build_list_keys_request( @@ -543,12 +542,12 @@ async def regenerate_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -583,7 +582,7 @@ async def regenerate_keys( Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -612,10 +611,9 @@ async def regenerate_keys( :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Is either a RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters or IO[bytes] :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -629,7 +627,7 @@ async def regenerate_keys( _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-11-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.AccessKeys] = kwargs.pop("cls", None) @@ -683,7 +681,7 @@ def list_by_namespace( skip: Optional[int] = None, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.SBQueue"]: + ) -> AsyncItemPaged["_models.SBQueue"]: """Gets the queues within a namespace. .. seealso:: @@ -701,14 +699,13 @@ def list_by_namespace( Default value is None. :type top: int :return: An iterator like instance of either SBQueue or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBQueue] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.SBQueue] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBQueueListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -743,7 +740,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 ) @@ -799,12 +796,12 @@ async def create_or_update( :param queue_name: The queue name. Required. :type queue_name: str :param parameters: Parameters supplied to create or update a queue resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :type parameters: ~azure.mgmt.servicebus.models.SBQueue :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :rtype: ~azure.mgmt.servicebus.models.SBQueue :raises ~azure.core.exceptions.HttpResponseError: """ @@ -836,7 +833,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :rtype: ~azure.mgmt.servicebus.models.SBQueue :raises ~azure.core.exceptions.HttpResponseError: """ @@ -862,9 +859,9 @@ async def create_or_update( :type queue_name: str :param parameters: Parameters supplied to create or update a queue resource. Is either a SBQueue type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBQueue or IO[bytes] :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :rtype: ~azure.mgmt.servicebus.models.SBQueue :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -878,7 +875,7 @@ async def create_or_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-11-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.SBQueue] = kwargs.pop("cls", None) @@ -951,7 +948,7 @@ async def delete(self, resource_group_name: str, namespace_name: str, queue_name _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -996,7 +993,7 @@ async def get( :param queue_name: The queue name. Required. :type queue_name: str :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :rtype: ~azure.mgmt.servicebus.models.SBQueue :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1010,7 +1007,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBQueue] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_rules_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_rules_operations.py similarity index 94% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_rules_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_rules_operations.py index 70f0c7843f09..071a8e41e763 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_rules_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_rules_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -28,7 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._rules_operations import ( build_create_or_update_request, build_delete_request, @@ -47,7 +47,7 @@ class RulesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`rules` attribute. """ @@ -61,7 +61,6 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_subscriptions( @@ -73,7 +72,7 @@ def list_by_subscriptions( skip: Optional[int] = None, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.Rule"]: + ) -> AsyncItemPaged["_models.Rule"]: """List all the rules within given topic-subscription. :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -92,13 +91,13 @@ def list_by_subscriptions( Default value is None. :type top: int :return: An iterator like instance of either Rule or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.Rule] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.Rule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -135,7 +134,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 ) @@ -194,12 +193,12 @@ async def create_or_update( :param rule_name: The rule name. Required. :type rule_name: str :param parameters: Parameters supplied to create a rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :type parameters: ~azure.mgmt.servicebus.models.Rule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :rtype: ~azure.mgmt.servicebus.models.Rule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -234,7 +233,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :rtype: ~azure.mgmt.servicebus.models.Rule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -263,9 +262,9 @@ async def create_or_update( :type rule_name: str :param parameters: Parameters supplied to create a rule. Is either a Rule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.Rule or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.Rule or IO[bytes] :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :rtype: ~azure.mgmt.servicebus.models.Rule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -279,7 +278,7 @@ async def create_or_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-11-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.Rule] = kwargs.pop("cls", None) @@ -363,7 +362,7 @@ async def 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -417,7 +416,7 @@ async def get( :param rule_name: The rule name. Required. :type rule_name: str :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :rtype: ~azure.mgmt.servicebus.models.Rule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -431,7 +430,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Rule] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_subscriptions_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_subscriptions_operations.py similarity index 93% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_subscriptions_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_subscriptions_operations.py index de10d51b01be..820d8d3dbb9c 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_subscriptions_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_subscriptions_operations.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -28,7 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._subscriptions_operations import ( build_create_or_update_request, build_delete_request, @@ -47,7 +47,7 @@ class SubscriptionsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`subscriptions` attribute. """ @@ -61,7 +61,6 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_topic( @@ -72,7 +71,7 @@ def list_by_topic( skip: Optional[int] = None, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.SBSubscription"]: + ) -> AsyncItemPaged["_models.SBSubscription"]: """List all the subscriptions under a specified topic. .. seealso:: @@ -92,14 +91,13 @@ def list_by_topic( Default value is None. :type top: int :return: An iterator like instance of either SBSubscription or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.SBSubscription] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBSubscriptionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -135,7 +133,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 ) @@ -194,12 +192,12 @@ async def create_or_update( :param subscription_name: The subscription name. Required. :type subscription_name: str :param parameters: Parameters supplied to create a subscription resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :type parameters: ~azure.mgmt.servicebus.models.SBSubscription :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :rtype: ~azure.mgmt.servicebus.models.SBSubscription :raises ~azure.core.exceptions.HttpResponseError: """ @@ -234,7 +232,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :rtype: ~azure.mgmt.servicebus.models.SBSubscription :raises ~azure.core.exceptions.HttpResponseError: """ @@ -263,9 +261,9 @@ async def create_or_update( :type subscription_name: str :param parameters: Parameters supplied to create a subscription resource. Is either a SBSubscription type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBSubscription or IO[bytes] :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :rtype: ~azure.mgmt.servicebus.models.SBSubscription :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -279,7 +277,7 @@ async def create_or_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-11-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.SBSubscription] = kwargs.pop("cls", None) @@ -357,7 +355,7 @@ async def 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -405,7 +403,7 @@ async def get( :param subscription_name: The subscription name. Required. :type subscription_name: str :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :rtype: ~azure.mgmt.servicebus.models.SBSubscription :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -419,7 +417,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBSubscription] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_topics_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_topics_operations.py similarity index 94% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_topics_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_topics_operations.py index 72b3173e29e2..3e15a49e8411 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/operations/_topics_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/aio/operations/_topics_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -29,7 +29,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ...._serialization import Deserializer, Serializer +from ..._utils.serialization import Deserializer, Serializer from ...operations._topics_operations import ( build_create_or_update_authorization_rule_request, build_create_or_update_request, @@ -54,7 +54,7 @@ class TopicsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.aio.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.aio.ServiceBusManagementClient`'s :attr:`topics` attribute. """ @@ -68,12 +68,11 @@ def __init__(self, *args, **kwargs) -> None: ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_authorization_rules( self, resource_group_name: str, namespace_name: str, topic_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SBAuthorizationRule"]: + ) -> AsyncItemPaged["_models.SBAuthorizationRule"]: """Gets authorization rules for a topic. .. seealso:: @@ -87,13 +86,13 @@ def list_authorization_rules( :type topic_name: str :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -127,7 +126,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 ) @@ -186,12 +185,12 @@ async def create_or_update_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -226,7 +225,7 @@ async def create_or_update_authorization_rule( Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -255,9 +254,9 @@ async def create_or_update_authorization_rule( :type authorization_rule_name: str :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule or IO[bytes] :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -271,7 +270,7 @@ async def create_or_update_authorization_rule( _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-11-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.SBAuthorizationRule] = kwargs.pop("cls", None) @@ -340,7 +339,7 @@ async def get_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -354,7 +353,7 @@ async def get_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) _request = build_get_authorization_rule_request( @@ -425,7 +424,7 @@ async def delete_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_authorization_rule_request( @@ -478,7 +477,7 @@ async def list_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -492,7 +491,7 @@ async def list_keys( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) _request = build_list_keys_request( @@ -552,12 +551,12 @@ async def regenerate_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -592,7 +591,7 @@ async def regenerate_keys( Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -621,10 +620,9 @@ async def regenerate_keys( :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Is either a RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters or IO[bytes] :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -638,7 +636,7 @@ async def regenerate_keys( _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-11-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.AccessKeys] = kwargs.pop("cls", None) @@ -692,7 +690,7 @@ def list_by_namespace( skip: Optional[int] = None, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.SBTopic"]: + ) -> AsyncItemPaged["_models.SBTopic"]: """Gets all the topics in a namespace. .. seealso:: @@ -710,14 +708,13 @@ def list_by_namespace( Default value is None. :type top: int :return: An iterator like instance of either SBTopic or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBTopic] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.models.SBTopic] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBTopicListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -752,7 +749,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 ) @@ -808,12 +805,12 @@ async def create_or_update( :param topic_name: The topic name. Required. :type topic_name: str :param parameters: Parameters supplied to create a topic resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :type parameters: ~azure.mgmt.servicebus.models.SBTopic :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :rtype: ~azure.mgmt.servicebus.models.SBTopic :raises ~azure.core.exceptions.HttpResponseError: """ @@ -845,7 +842,7 @@ async def create_or_update( Default value is "application/json". :paramtype content_type: str :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :rtype: ~azure.mgmt.servicebus.models.SBTopic :raises ~azure.core.exceptions.HttpResponseError: """ @@ -871,9 +868,9 @@ async def create_or_update( :type topic_name: str :param parameters: Parameters supplied to create a topic resource. Is either a SBTopic type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBTopic or IO[bytes] :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :rtype: ~azure.mgmt.servicebus.models.SBTopic :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -887,7 +884,7 @@ async def create_or_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-11-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.SBTopic] = kwargs.pop("cls", None) @@ -960,7 +957,7 @@ async def delete(self, resource_group_name: str, namespace_name: str, topic_name _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1005,7 +1002,7 @@ async def get( :param topic_name: The topic name. Required. :type topic_name: str :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :rtype: ~azure.mgmt.servicebus.models.SBTopic :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1019,7 +1016,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBTopic] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models.py deleted file mode 100644 index acbc7f58791f..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models.py +++ /dev/null @@ -1,7 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from .v2021_11_01.models import * diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py similarity index 100% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/__init__.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/__init__.py diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/_models_py3.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models_py3.py similarity index 91% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/_models_py3.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models_py3.py index 23eaeeea105a..e57ff5d4744d 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/_models_py3.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_models_py3.py @@ -11,7 +11,7 @@ import datetime from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union -from ... import _serialization +from .._utils import serialization as _serialization if TYPE_CHECKING: from .. import models as _models @@ -177,12 +177,11 @@ class ArmDisasterRecovery(ProxyResource): :ivar location: The geo-location where the resource lives. :vartype location: str :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar provisioning_state: Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'. Known values are: "Accepted", "Succeeded", and "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.ProvisioningStateDR + :vartype provisioning_state: str or ~azure.mgmt.servicebus.models.ProvisioningStateDR :ivar pending_replication_operations_count: Number of entities pending to be replicated. :vartype pending_replication_operations_count: int :ivar partner_namespace: ARM Id of the Primary/Secondary eventhub namespace name, which is part @@ -193,7 +192,7 @@ class ArmDisasterRecovery(ProxyResource): :vartype alternate_name: str :ivar role: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Known values are: "Primary", "PrimaryNotReplicating", and "Secondary". - :vartype role: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.RoleDisasterRecovery + :vartype role: str or ~azure.mgmt.servicebus.models.RoleDisasterRecovery """ _validation = { @@ -246,7 +245,7 @@ class ArmDisasterRecoveryListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of Alias(Disaster Recovery configurations). - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery] + :vartype value: list[~azure.mgmt.servicebus.models.ArmDisasterRecovery] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of Alias(Disaster Recovery configuration). :vartype next_link: str @@ -264,7 +263,7 @@ class ArmDisasterRecoveryListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.ArmDisasterRecovery"]] = None, **kwargs: Any) -> None: """ :keyword value: List of Alias(Disaster Recovery configurations). - :paramtype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery] + :paramtype value: list[~azure.mgmt.servicebus.models.ArmDisasterRecovery] """ super().__init__(**kwargs) self.value = value @@ -314,7 +313,7 @@ class CheckNameAvailabilityResult(_serialization.Model): :ivar reason: The reason for unavailability of a namespace. Known values are: "None", "InvalidName", "SubscriptionIsDisabled", "NameInUse", "NameInLockdown", and "TooManyNamespaceInCurrentSubscription". - :vartype reason: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.UnavailableReason + :vartype reason: str or ~azure.mgmt.servicebus.models.UnavailableReason """ _validation = { @@ -341,7 +340,7 @@ def __init__( :keyword reason: The reason for unavailability of a namespace. Known values are: "None", "InvalidName", "SubscriptionIsDisabled", "NameInUse", "NameInLockdown", and "TooManyNamespaceInCurrentSubscription". - :paramtype reason: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.UnavailableReason + :paramtype reason: str or ~azure.mgmt.servicebus.models.UnavailableReason """ super().__init__(**kwargs) self.message: Optional[str] = None @@ -354,8 +353,7 @@ class ConnectionState(_serialization.Model): :ivar status: Status of the connection. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". - :vartype status: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateLinkConnectionStatus + :vartype status: str or ~azure.mgmt.servicebus.models.PrivateLinkConnectionStatus :ivar description: Description of the connection state. :vartype description: str """ @@ -375,8 +373,7 @@ def __init__( """ :keyword status: Status of the connection. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". - :paramtype status: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateLinkConnectionStatus + :paramtype status: str or ~azure.mgmt.servicebus.models.PrivateLinkConnectionStatus :keyword description: Description of the connection state. :paramtype description: str """ @@ -479,8 +476,7 @@ class Encryption(_serialization.Model): """Properties to configure Encryption. :ivar key_vault_properties: Properties of KeyVault. - :vartype key_vault_properties: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.KeyVaultProperties] + :vartype key_vault_properties: list[~azure.mgmt.servicebus.models.KeyVaultProperties] :ivar key_source: Enumerates the possible value of keySource for Encryption. Default value is "Microsoft.KeyVault". :vartype key_source: str @@ -504,8 +500,7 @@ def __init__( ) -> None: """ :keyword key_vault_properties: Properties of KeyVault. - :paramtype key_vault_properties: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.KeyVaultProperties] + :paramtype key_vault_properties: list[~azure.mgmt.servicebus.models.KeyVaultProperties] :keyword key_source: Enumerates the possible value of keySource for Encryption. Default value is "Microsoft.KeyVault". :paramtype key_source: str @@ -551,7 +546,7 @@ class ErrorResponse(_serialization.Model): """The resource management error response. :ivar error: The error object. - :vartype error: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ErrorResponseError + :vartype error: ~azure.mgmt.servicebus.models.ErrorResponseError """ _attribute_map = { @@ -561,7 +556,7 @@ class ErrorResponse(_serialization.Model): def __init__(self, *, error: Optional["_models.ErrorResponseError"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. - :paramtype error: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ErrorResponseError + :paramtype error: ~azure.mgmt.servicebus.models.ErrorResponseError """ super().__init__(**kwargs) self.error = error @@ -579,10 +574,9 @@ class ErrorResponseError(_serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.ErrorResponse] + :vartype details: list[~azure.mgmt.servicebus.models.ErrorResponse] :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.ErrorAdditionalInfo] + :vartype additional_info: list[~azure.mgmt.servicebus.models.ErrorAdditionalInfo] """ _validation = { @@ -645,11 +639,10 @@ class Identity(_serialization.Model): :vartype tenant_id: str :ivar type: Type of managed service identity. Known values are: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", and "None". - :vartype type: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.ManagedServiceIdentityType + :vartype type: str or ~azure.mgmt.servicebus.models.ManagedServiceIdentityType :ivar user_assigned_identities: Properties for User Assigned Identities. :vartype user_assigned_identities: dict[str, - ~azure.mgmt.servicebus.v2022_10_01_preview.models.UserAssignedIdentity] + ~azure.mgmt.servicebus.models.UserAssignedIdentity] """ _validation = { @@ -674,11 +667,10 @@ def __init__( """ :keyword type: Type of managed service identity. Known values are: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", and "None". - :paramtype type: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.ManagedServiceIdentityType + :paramtype type: str or ~azure.mgmt.servicebus.models.ManagedServiceIdentityType :keyword user_assigned_identities: Properties for User Assigned Identities. :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.servicebus.v2022_10_01_preview.models.UserAssignedIdentity] + ~azure.mgmt.servicebus.models.UserAssignedIdentity] """ super().__init__(**kwargs) self.principal_id: Optional[str] = None @@ -697,8 +689,7 @@ class KeyVaultProperties(_serialization.Model): :ivar key_version: Version of KeyVault. :vartype key_version: str :ivar identity: - :vartype identity: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.UserAssignedIdentityProperties + :vartype identity: ~azure.mgmt.servicebus.models.UserAssignedIdentityProperties """ _attribute_map = { @@ -725,8 +716,7 @@ def __init__( :keyword key_version: Version of KeyVault. :paramtype key_version: str :keyword identity: - :paramtype identity: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.UserAssignedIdentityProperties + :paramtype identity: ~azure.mgmt.servicebus.models.UserAssignedIdentityProperties """ super().__init__(**kwargs) self.key_name = key_name @@ -785,8 +775,7 @@ class MigrationConfigListResult(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: List of Migration Configs. - :vartype value: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] + :vartype value: list[~azure.mgmt.servicebus.models.MigrationConfigProperties] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of migrationConfigurations. :vartype next_link: str @@ -804,8 +793,7 @@ class MigrationConfigListResult(_serialization.Model): def __init__(self, *, value: Optional[List["_models.MigrationConfigProperties"]] = None, **kwargs: Any) -> None: """ :keyword value: List of Migration Configs. - :paramtype value: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] + :paramtype value: list[~azure.mgmt.servicebus.models.MigrationConfigProperties] """ super().__init__(**kwargs) self.value = value @@ -828,7 +816,7 @@ class MigrationConfigProperties(ProxyResource): :ivar location: The geo-location where the resource lives. :vartype location: str :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar provisioning_state: Provisioning state of Migration Configuration. :vartype provisioning_state: str :ivar pending_replication_operations_count: Number of entities pending to be replicated. @@ -902,22 +890,21 @@ class NetworkRuleSet(ProxyResource): :ivar location: The geo-location where the resource lives. :vartype location: str :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar trusted_service_access_enabled: Value that indicates whether Trusted Service Access is Enabled or not. :vartype trusted_service_access_enabled: bool :ivar default_action: Default Action for Network Rule Set. Known values are: "Allow" and "Deny". - :vartype default_action: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.DefaultAction + :vartype default_action: str or ~azure.mgmt.servicebus.models.DefaultAction :ivar virtual_network_rules: List VirtualNetwork Rules. :vartype virtual_network_rules: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.NWRuleSetVirtualNetworkRules] + list[~azure.mgmt.servicebus.models.NWRuleSetVirtualNetworkRules] :ivar ip_rules: List of IpRules. - :vartype ip_rules: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.NWRuleSetIpRules] + :vartype ip_rules: list[~azure.mgmt.servicebus.models.NWRuleSetIpRules] :ivar public_network_access: This determines if traffic is allowed over public network. By default it is enabled. Known values are: "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.PublicNetworkAccessFlag + :vartype public_network_access: str or ~azure.mgmt.servicebus.models.PublicNetworkAccessFlag """ _validation = { @@ -957,17 +944,15 @@ def __init__( :paramtype trusted_service_access_enabled: bool :keyword default_action: Default Action for Network Rule Set. Known values are: "Allow" and "Deny". - :paramtype default_action: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.DefaultAction + :paramtype default_action: str or ~azure.mgmt.servicebus.models.DefaultAction :keyword virtual_network_rules: List VirtualNetwork Rules. :paramtype virtual_network_rules: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.NWRuleSetVirtualNetworkRules] + list[~azure.mgmt.servicebus.models.NWRuleSetVirtualNetworkRules] :keyword ip_rules: List of IpRules. - :paramtype ip_rules: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.NWRuleSetIpRules] + :paramtype ip_rules: list[~azure.mgmt.servicebus.models.NWRuleSetIpRules] :keyword public_network_access: This determines if traffic is allowed over public network. By default it is enabled. Known values are: "Enabled" and "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.PublicNetworkAccessFlag + :paramtype public_network_access: str or ~azure.mgmt.servicebus.models.PublicNetworkAccessFlag """ super().__init__(**kwargs) self.system_data: Optional["_models.SystemData"] = None @@ -982,7 +967,7 @@ class NetworkRuleSetListResult(_serialization.Model): """The response of the List NetworkRuleSet operation. :ivar value: Result of the List NetworkRuleSet operation. - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet] + :vartype value: list[~azure.mgmt.servicebus.models.NetworkRuleSet] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of NetworkRuleSet. :vartype next_link: str @@ -998,7 +983,7 @@ def __init__( ) -> None: """ :keyword value: Result of the List NetworkRuleSet operation. - :paramtype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet] + :paramtype value: list[~azure.mgmt.servicebus.models.NetworkRuleSet] :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete list of NetworkRuleSet. :paramtype next_link: str @@ -1014,7 +999,7 @@ class NWRuleSetIpRules(_serialization.Model): :ivar ip_mask: IP Mask. :vartype ip_mask: str :ivar action: The IP Filter Action. "Allow" - :vartype action: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleIPAction + :vartype action: str or ~azure.mgmt.servicebus.models.NetworkRuleIPAction """ _attribute_map = { @@ -1033,7 +1018,7 @@ def __init__( :keyword ip_mask: IP Mask. :paramtype ip_mask: str :keyword action: The IP Filter Action. "Allow" - :paramtype action: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleIPAction + :paramtype action: str or ~azure.mgmt.servicebus.models.NetworkRuleIPAction """ super().__init__(**kwargs) self.ip_mask = ip_mask @@ -1044,7 +1029,7 @@ class NWRuleSetVirtualNetworkRules(_serialization.Model): """Description of VirtualNetworkRules - NetworkRules resource. :ivar subnet: Subnet properties. - :vartype subnet: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Subnet + :vartype subnet: ~azure.mgmt.servicebus.models.Subnet :ivar ignore_missing_vnet_service_endpoint: Value that indicates whether to ignore missing VNet Service Endpoint. :vartype ignore_missing_vnet_service_endpoint: bool @@ -1064,7 +1049,7 @@ def __init__( ) -> None: """ :keyword subnet: Subnet properties. - :paramtype subnet: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Subnet + :paramtype subnet: ~azure.mgmt.servicebus.models.Subnet :keyword ignore_missing_vnet_service_endpoint: Value that indicates whether to ignore missing VNet Service Endpoint. :paramtype ignore_missing_vnet_service_endpoint: bool @@ -1084,7 +1069,7 @@ class Operation(_serialization.Model): :ivar is_data_action: Indicates whether the operation is a data action. :vartype is_data_action: bool :ivar display: Display of the operation. - :vartype display: ~azure.mgmt.servicebus.v2022_10_01_preview.models.OperationDisplay + :vartype display: ~azure.mgmt.servicebus.models.OperationDisplay :ivar origin: Origin of the operation. :vartype origin: str :ivar properties: Properties of the operation. @@ -1116,7 +1101,7 @@ def __init__( :keyword is_data_action: Indicates whether the operation is a data action. :paramtype is_data_action: bool :keyword display: Display of the operation. - :paramtype display: ~azure.mgmt.servicebus.v2022_10_01_preview.models.OperationDisplay + :paramtype display: ~azure.mgmt.servicebus.models.OperationDisplay :keyword origin: Origin of the operation. :paramtype origin: str :keyword properties: Properties of the operation. @@ -1176,7 +1161,7 @@ class OperationListResult(_serialization.Model): :ivar value: List of ServiceBus operations supported by the Microsoft.ServiceBus resource provider. - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.Operation] + :vartype value: list[~azure.mgmt.servicebus.models.Operation] :ivar next_link: URL to get the next set of operation list results if there are any. :vartype next_link: str """ @@ -1234,16 +1219,14 @@ class PrivateEndpointConnection(ProxyResource): :ivar location: The geo-location where the resource lives. :vartype location: str :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar private_endpoint: The Private Endpoint resource for this Connection. - :vartype private_endpoint: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpoint + :vartype private_endpoint: ~azure.mgmt.servicebus.models.PrivateEndpoint :ivar private_link_service_connection_state: Details about the state of the connection. - :vartype private_link_service_connection_state: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.ConnectionState + :vartype private_link_service_connection_state: ~azure.mgmt.servicebus.models.ConnectionState :ivar provisioning_state: Provisioning state of the Private Endpoint Connection. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.EndPointProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.servicebus.models.EndPointProvisioningState """ _validation = { @@ -1278,14 +1261,12 @@ def __init__( ) -> None: """ :keyword private_endpoint: The Private Endpoint resource for this Connection. - :paramtype private_endpoint: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpoint + :paramtype private_endpoint: ~azure.mgmt.servicebus.models.PrivateEndpoint :keyword private_link_service_connection_state: Details about the state of the connection. - :paramtype private_link_service_connection_state: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.ConnectionState + :paramtype private_link_service_connection_state: ~azure.mgmt.servicebus.models.ConnectionState :keyword provisioning_state: Provisioning state of the Private Endpoint Connection. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.EndPointProvisioningState + :paramtype provisioning_state: str or ~azure.mgmt.servicebus.models.EndPointProvisioningState """ super().__init__(**kwargs) self.system_data: Optional["_models.SystemData"] = None @@ -1298,8 +1279,7 @@ class PrivateEndpointConnectionListResult(_serialization.Model): """Result of the list of all private endpoint connections operation. :ivar value: A collection of private endpoint connection resources. - :vartype value: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection] + :vartype value: list[~azure.mgmt.servicebus.models.PrivateEndpointConnection] :ivar next_link: A link for the next page of private endpoint connection resources. :vartype next_link: str """ @@ -1318,8 +1298,7 @@ def __init__( ) -> None: """ :keyword value: A collection of private endpoint connection resources. - :paramtype value: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection] + :paramtype value: list[~azure.mgmt.servicebus.models.PrivateEndpointConnection] :keyword next_link: A link for the next page of private endpoint connection resources. :paramtype next_link: str """ @@ -1392,7 +1371,7 @@ class PrivateLinkResourcesListResult(_serialization.Model): """Result of the List private link resources operation. :ivar value: A collection of private link resources. - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateLinkResource] + :vartype value: list[~azure.mgmt.servicebus.models.PrivateLinkResource] :ivar next_link: A link for the next page of private link resources. :vartype next_link: str """ @@ -1411,7 +1390,7 @@ def __init__( ) -> None: """ :keyword value: A collection of private link resources. - :paramtype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateLinkResource] + :paramtype value: list[~azure.mgmt.servicebus.models.PrivateLinkResource] :keyword next_link: A link for the next page of private link resources. :paramtype next_link: str """ @@ -1428,7 +1407,7 @@ class RegenerateAccessKeyParameters(_serialization.Model): :ivar key_type: The access key to regenerate. Required. Known values are: "PrimaryKey" and "SecondaryKey". - :vartype key_type: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.KeyType + :vartype key_type: str or ~azure.mgmt.servicebus.models.KeyType :ivar key: Optional, if the key value provided, is reset for KeyType value or autogenerate Key value set for keyType. :vartype key: str @@ -1447,7 +1426,7 @@ def __init__(self, *, key_type: Union[str, "_models.KeyType"], key: Optional[str """ :keyword key_type: The access key to regenerate. Required. Known values are: "PrimaryKey" and "SecondaryKey". - :paramtype key_type: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.KeyType + :paramtype key_type: str or ~azure.mgmt.servicebus.models.KeyType :keyword key: Optional, if the key value provided, is reset for KeyType value or autogenerate Key value set for keyType. :paramtype key: str @@ -1549,18 +1528,17 @@ class Rule(ProxyResource): :ivar location: The geo-location where the resource lives. :vartype location: str :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression. - :vartype action: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Action + :vartype action: ~azure.mgmt.servicebus.models.Action :ivar filter_type: Filter type that is evaluated against a BrokeredMessage. Known values are: "SqlFilter" and "CorrelationFilter". - :vartype filter_type: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.FilterType + :vartype filter_type: str or ~azure.mgmt.servicebus.models.FilterType :ivar sql_filter: Properties of sqlFilter. - :vartype sql_filter: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SqlFilter + :vartype sql_filter: ~azure.mgmt.servicebus.models.SqlFilter :ivar correlation_filter: Properties of correlationFilter. - :vartype correlation_filter: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.CorrelationFilter + :vartype correlation_filter: ~azure.mgmt.servicebus.models.CorrelationFilter """ _validation = { @@ -1595,15 +1573,14 @@ def __init__( """ :keyword action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter expression. - :paramtype action: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Action + :paramtype action: ~azure.mgmt.servicebus.models.Action :keyword filter_type: Filter type that is evaluated against a BrokeredMessage. Known values are: "SqlFilter" and "CorrelationFilter". - :paramtype filter_type: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.FilterType + :paramtype filter_type: str or ~azure.mgmt.servicebus.models.FilterType :keyword sql_filter: Properties of sqlFilter. - :paramtype sql_filter: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SqlFilter + :paramtype sql_filter: ~azure.mgmt.servicebus.models.SqlFilter :keyword correlation_filter: Properties of correlationFilter. - :paramtype correlation_filter: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.CorrelationFilter + :paramtype correlation_filter: ~azure.mgmt.servicebus.models.CorrelationFilter """ super().__init__(**kwargs) self.system_data: Optional["_models.SystemData"] = None @@ -1617,7 +1594,7 @@ class RuleListResult(_serialization.Model): """The response of the List rule operation. :ivar value: Result of the List Rules operation. - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule] + :vartype value: list[~azure.mgmt.servicebus.models.Rule] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of rules. :vartype next_link: str @@ -1633,7 +1610,7 @@ def __init__( ) -> None: """ :keyword value: Result of the List Rules operation. - :paramtype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule] + :paramtype value: list[~azure.mgmt.servicebus.models.Rule] :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete list of rules. :paramtype next_link: str @@ -1659,9 +1636,9 @@ class SBAuthorizationRule(ProxyResource): :ivar location: The geo-location where the resource lives. :vartype location: str :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar rights: The rights associated with the rule. - :vartype rights: list[str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessRights] + :vartype rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] """ _validation = { @@ -1684,7 +1661,7 @@ class SBAuthorizationRule(ProxyResource): def __init__(self, *, rights: Optional[List[Union[str, "_models.AccessRights"]]] = None, **kwargs: Any) -> None: """ :keyword rights: The rights associated with the rule. - :paramtype rights: list[str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessRights] + :paramtype rights: list[str or ~azure.mgmt.servicebus.models.AccessRights] """ super().__init__(**kwargs) self.system_data: Optional["_models.SystemData"] = None @@ -1695,7 +1672,7 @@ class SBAuthorizationRuleListResult(_serialization.Model): """The response to the List Namespace operation. :ivar value: Result of the List Authorization Rules operation. - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] + :vartype value: list[~azure.mgmt.servicebus.models.SBAuthorizationRule] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of Authorization Rules. :vartype next_link: str @@ -1715,7 +1692,7 @@ def __init__( ) -> None: """ :keyword value: Result of the List Authorization Rules operation. - :paramtype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] + :paramtype value: list[~azure.mgmt.servicebus.models.SBAuthorizationRule] :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete list of Authorization Rules. :paramtype next_link: str @@ -1834,15 +1811,14 @@ class SBNamespace(TrackedResource): :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar sku: Properties of SKU. - :vartype sku: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSku + :vartype sku: ~azure.mgmt.servicebus.models.SBSku :ivar identity: Properties of BYOK Identity description. - :vartype identity: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Identity + :vartype identity: ~azure.mgmt.servicebus.models.Identity :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar minimum_tls_version: The minimum TLS version for the cluster to support, e.g. '1.2'. Known values are: "1.0", "1.1", and "1.2". - :vartype minimum_tls_version: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.TlsVersion + :vartype minimum_tls_version: str or ~azure.mgmt.servicebus.models.TlsVersion :ivar provisioning_state: Provisioning state of the namespace. :vartype provisioning_state: str :ivar status: Status of the namespace. @@ -1859,10 +1835,10 @@ class SBNamespace(TrackedResource): supported availability zones. :vartype zone_redundant: bool :ivar encryption: Properties of BYOK Encryption description. - :vartype encryption: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Encryption + :vartype encryption: ~azure.mgmt.servicebus.models.Encryption :ivar private_endpoint_connections: List of private endpoint connections. :vartype private_endpoint_connections: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection] + list[~azure.mgmt.servicebus.models.PrivateEndpointConnection] :ivar disable_local_auth: This property disables SAS authentication for the Service Bus namespace. :vartype disable_local_auth: bool @@ -1870,8 +1846,7 @@ class SBNamespace(TrackedResource): :vartype alternate_name: str :ivar public_network_access: This determines if traffic is allowed over public network. By default it is enabled. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". - :vartype public_network_access: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.servicebus.models.PublicNetworkAccess :ivar premium_messaging_partitions: The number of partitions of a Service Bus namespace. This property is only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4. @@ -1943,21 +1918,20 @@ def __init__( :keyword tags: Resource tags. :paramtype tags: dict[str, str] :keyword sku: Properties of SKU. - :paramtype sku: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSku + :paramtype sku: ~azure.mgmt.servicebus.models.SBSku :keyword identity: Properties of BYOK Identity description. - :paramtype identity: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Identity + :paramtype identity: ~azure.mgmt.servicebus.models.Identity :keyword minimum_tls_version: The minimum TLS version for the cluster to support, e.g. '1.2'. Known values are: "1.0", "1.1", and "1.2". - :paramtype minimum_tls_version: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.TlsVersion + :paramtype minimum_tls_version: str or ~azure.mgmt.servicebus.models.TlsVersion :keyword zone_redundant: Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones. :paramtype zone_redundant: bool :keyword encryption: Properties of BYOK Encryption description. - :paramtype encryption: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Encryption + :paramtype encryption: ~azure.mgmt.servicebus.models.Encryption :keyword private_endpoint_connections: List of private endpoint connections. :paramtype private_endpoint_connections: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection] + list[~azure.mgmt.servicebus.models.PrivateEndpointConnection] :keyword disable_local_auth: This property disables SAS authentication for the Service Bus namespace. :paramtype disable_local_auth: bool @@ -1965,8 +1939,7 @@ def __init__( :paramtype alternate_name: str :keyword public_network_access: This determines if traffic is allowed over public network. By default it is enabled. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". - :paramtype public_network_access: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.PublicNetworkAccess + :paramtype public_network_access: str or ~azure.mgmt.servicebus.models.PublicNetworkAccess :keyword premium_messaging_partitions: The number of partitions of a Service Bus namespace. This property is only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4. @@ -1996,7 +1969,7 @@ class SBNamespaceListResult(_serialization.Model): """The response of the List Namespace operation. :ivar value: Result of the List Namespace operation. - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] + :vartype value: list[~azure.mgmt.servicebus.models.SBNamespace] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of Namespaces. :vartype next_link: str @@ -2012,7 +1985,7 @@ def __init__( ) -> None: """ :keyword value: Result of the List Namespace operation. - :paramtype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] + :paramtype value: list[~azure.mgmt.servicebus.models.SBNamespace] :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete list of Namespaces. :paramtype next_link: str @@ -2038,9 +2011,9 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar sku: Properties of SKU. - :vartype sku: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSku + :vartype sku: ~azure.mgmt.servicebus.models.SBSku :ivar identity: Properties of BYOK Identity description. - :vartype identity: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Identity + :vartype identity: ~azure.mgmt.servicebus.models.Identity :ivar provisioning_state: Provisioning state of the namespace. :vartype provisioning_state: str :ivar status: Status of the namespace. @@ -2054,10 +2027,10 @@ class SBNamespaceUpdateParameters(ResourceNamespacePatch): :ivar metric_id: Identifier for Azure Insights metrics. :vartype metric_id: str :ivar encryption: Properties of BYOK Encryption description. - :vartype encryption: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Encryption + :vartype encryption: ~azure.mgmt.servicebus.models.Encryption :ivar private_endpoint_connections: List of private endpoint connections. :vartype private_endpoint_connections: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection] + list[~azure.mgmt.servicebus.models.PrivateEndpointConnection] :ivar disable_local_auth: This property disables SAS authentication for the Service Bus namespace. :vartype disable_local_auth: bool @@ -2119,14 +2092,14 @@ def __init__( :keyword tags: Resource tags. :paramtype tags: dict[str, str] :keyword sku: Properties of SKU. - :paramtype sku: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSku + :paramtype sku: ~azure.mgmt.servicebus.models.SBSku :keyword identity: Properties of BYOK Identity description. - :paramtype identity: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Identity + :paramtype identity: ~azure.mgmt.servicebus.models.Identity :keyword encryption: Properties of BYOK Encryption description. - :paramtype encryption: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Encryption + :paramtype encryption: ~azure.mgmt.servicebus.models.Encryption :keyword private_endpoint_connections: List of private endpoint connections. :paramtype private_endpoint_connections: - list[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection] + list[~azure.mgmt.servicebus.models.PrivateEndpointConnection] :keyword disable_local_auth: This property disables SAS authentication for the Service Bus namespace. :paramtype disable_local_auth: bool @@ -2164,9 +2137,9 @@ class SBQueue(ProxyResource): :ivar location: The geo-location where the resource lives. :vartype location: str :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar count_details: Message Count Details. - :vartype count_details: ~azure.mgmt.servicebus.v2022_10_01_preview.models.MessageCountDetails + :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails :ivar created_at: The exact time the message was created. :vartype created_at: ~datetime.datetime :ivar updated_at: The exact time the message was updated. @@ -2210,7 +2183,7 @@ class SBQueue(ProxyResource): :ivar status: Enumerates the possible values for the status of a messaging entity. Known values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", "Deleting", "Renaming", and "Unknown". - :vartype status: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.EntityStatus + :vartype status: str or ~azure.mgmt.servicebus.models.EntityStatus :ivar enable_batched_operations: Value that indicates whether server-side batched operations are enabled. :vartype enable_batched_operations: bool @@ -2330,7 +2303,7 @@ def __init__( # pylint: disable=too-many-locals :keyword status: Enumerates the possible values for the status of a messaging entity. Known values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", "Deleting", "Renaming", and "Unknown". - :paramtype status: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.EntityStatus + :paramtype status: str or ~azure.mgmt.servicebus.models.EntityStatus :keyword enable_batched_operations: Value that indicates whether server-side batched operations are enabled. :paramtype enable_batched_operations: bool @@ -2379,7 +2352,7 @@ class SBQueueListResult(_serialization.Model): """The response to the List Queues operation. :ivar value: Result of the List Queues operation. - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue] + :vartype value: list[~azure.mgmt.servicebus.models.SBQueue] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of queues. :vartype next_link: str @@ -2395,7 +2368,7 @@ def __init__( ) -> None: """ :keyword value: Result of the List Queues operation. - :paramtype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue] + :paramtype value: list[~azure.mgmt.servicebus.models.SBQueue] :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete list of queues. :paramtype next_link: str @@ -2411,10 +2384,10 @@ class SBSku(_serialization.Model): All required parameters must be populated in order to send to server. :ivar name: Name of this SKU. Required. Known values are: "Basic", "Standard", and "Premium". - :vartype name: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.SkuName + :vartype name: str or ~azure.mgmt.servicebus.models.SkuName :ivar tier: The billing tier of this particular SKU. Known values are: "Basic", "Standard", and "Premium". - :vartype tier: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.SkuTier + :vartype tier: str or ~azure.mgmt.servicebus.models.SkuTier :ivar capacity: Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, 8, 16} multiples of your properties.premiumMessagingPartitions setting. For example, If properties.premiumMessagingPartitions is 1 then possible capacity values are 1, 2, 4, 8, and @@ -2444,10 +2417,10 @@ def __init__( """ :keyword name: Name of this SKU. Required. Known values are: "Basic", "Standard", and "Premium". - :paramtype name: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.SkuName + :paramtype name: str or ~azure.mgmt.servicebus.models.SkuName :keyword tier: The billing tier of this particular SKU. Known values are: "Basic", "Standard", and "Premium". - :paramtype tier: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.SkuTier + :paramtype tier: str or ~azure.mgmt.servicebus.models.SkuTier :keyword capacity: Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, 8, 16} multiples of your properties.premiumMessagingPartitions setting. For example, If properties.premiumMessagingPartitions is 1 then possible capacity values are 1, 2, 4, 8, and @@ -2477,7 +2450,7 @@ class SBSubscription(ProxyResource): :ivar location: The geo-location where the resource lives. :vartype location: str :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar message_count: Number of messages. :vartype message_count: int :ivar created_at: Exact time the message was created. @@ -2487,7 +2460,7 @@ class SBSubscription(ProxyResource): :ivar updated_at: The exact time the message was updated. :vartype updated_at: ~datetime.datetime :ivar count_details: Message count details. - :vartype count_details: ~azure.mgmt.servicebus.v2022_10_01_preview.models.MessageCountDetails + :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails :ivar lock_duration: ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. :vartype lock_duration: ~datetime.timedelta @@ -2511,7 +2484,7 @@ class SBSubscription(ProxyResource): :ivar status: Enumerates the possible values for the status of a messaging entity. Known values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", "Deleting", "Renaming", and "Unknown". - :vartype status: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.EntityStatus + :vartype status: str or ~azure.mgmt.servicebus.models.EntityStatus :ivar enable_batched_operations: Value that indicates whether server-side batched operations are enabled. :vartype enable_batched_operations: bool @@ -2526,8 +2499,7 @@ class SBSubscription(ProxyResource): client id. :vartype is_client_affine: bool :ivar client_affine_properties: Properties specific to client affine subscriptions. - :vartype client_affine_properties: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBClientAffineProperties + :vartype client_affine_properties: ~azure.mgmt.servicebus.models.SBClientAffineProperties """ _validation = { @@ -2619,7 +2591,7 @@ def __init__( # pylint: disable=too-many-locals :keyword status: Enumerates the possible values for the status of a messaging entity. Known values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", "Deleting", "Renaming", and "Unknown". - :paramtype status: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.EntityStatus + :paramtype status: str or ~azure.mgmt.servicebus.models.EntityStatus :keyword enable_batched_operations: Value that indicates whether server-side batched operations are enabled. :paramtype enable_batched_operations: bool @@ -2635,8 +2607,7 @@ def __init__( # pylint: disable=too-many-locals client id. :paramtype is_client_affine: bool :keyword client_affine_properties: Properties specific to client affine subscriptions. - :paramtype client_affine_properties: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBClientAffineProperties + :paramtype client_affine_properties: ~azure.mgmt.servicebus.models.SBClientAffineProperties """ super().__init__(**kwargs) self.system_data: Optional["_models.SystemData"] = None @@ -2665,7 +2636,7 @@ class SBSubscriptionListResult(_serialization.Model): """The response to the List Subscriptions operation. :ivar value: Result of the List Subscriptions operation. - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription] + :vartype value: list[~azure.mgmt.servicebus.models.SBSubscription] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of subscriptions. :vartype next_link: str @@ -2681,7 +2652,7 @@ def __init__( ) -> None: """ :keyword value: Result of the List Subscriptions operation. - :paramtype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription] + :paramtype value: list[~azure.mgmt.servicebus.models.SBSubscription] :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete list of subscriptions. :paramtype next_link: str @@ -2707,7 +2678,7 @@ class SBTopic(ProxyResource): :ivar location: The geo-location where the resource lives. :vartype location: str :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SystemData + :vartype system_data: ~azure.mgmt.servicebus.models.SystemData :ivar size_in_bytes: Size of the topic, in bytes. :vartype size_in_bytes: int :ivar created_at: Exact time the message was created. @@ -2719,7 +2690,7 @@ class SBTopic(ProxyResource): :ivar subscription_count: Number of subscriptions. :vartype subscription_count: int :ivar count_details: Message count details. - :vartype count_details: ~azure.mgmt.servicebus.v2022_10_01_preview.models.MessageCountDetails + :vartype count_details: ~azure.mgmt.servicebus.models.MessageCountDetails :ivar default_message_time_to_live: ISO 8601 Default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. @@ -2742,7 +2713,7 @@ class SBTopic(ProxyResource): :ivar status: Enumerates the possible values for the status of a messaging entity. Known values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", "Deleting", "Renaming", and "Unknown". - :vartype status: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.EntityStatus + :vartype status: str or ~azure.mgmt.servicebus.models.EntityStatus :ivar support_ordering: Value that indicates whether the topic supports ordering. :vartype support_ordering: bool :ivar auto_delete_on_idle: ISO 8601 timespan idle interval after which the topic is @@ -2837,7 +2808,7 @@ def __init__( :keyword status: Enumerates the possible values for the status of a messaging entity. Known values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", "Deleting", "Renaming", and "Unknown". - :paramtype status: str or ~azure.mgmt.servicebus.v2022_10_01_preview.models.EntityStatus + :paramtype status: str or ~azure.mgmt.servicebus.models.EntityStatus :keyword support_ordering: Value that indicates whether the topic supports ordering. :paramtype support_ordering: bool :keyword auto_delete_on_idle: ISO 8601 timespan idle interval after which the topic is @@ -2875,7 +2846,7 @@ class SBTopicListResult(_serialization.Model): """The response to the List Topics operation. :ivar value: Result of the List Topics operation. - :vartype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic] + :vartype value: list[~azure.mgmt.servicebus.models.SBTopic] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of topics. :vartype next_link: str @@ -2891,7 +2862,7 @@ def __init__( ) -> None: """ :keyword value: Result of the List Topics operation. - :paramtype value: list[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic] + :paramtype value: list[~azure.mgmt.servicebus.models.SBTopic] :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete list of topics. :paramtype next_link: str @@ -2993,16 +2964,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.servicebus.v2022_10_01_preview.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.servicebus.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.servicebus.v2022_10_01_preview.models.CreatedByType + :vartype last_modified_by_type: str or ~azure.mgmt.servicebus.models.CreatedByType :ivar last_modified_at: The type of identity that last modified the resource. :vartype last_modified_at: ~datetime.datetime """ @@ -3032,16 +3001,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.servicebus.v2022_10_01_preview.models.CreatedByType + :paramtype created_by_type: str or ~azure.mgmt.servicebus.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.servicebus.v2022_10_01_preview.models.CreatedByType + :paramtype last_modified_by_type: str or ~azure.mgmt.servicebus.models.CreatedByType :keyword last_modified_at: The type of identity that last modified the resource. :paramtype last_modified_at: ~datetime.datetime """ diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_patch.py similarity index 61% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_patch.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_patch.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/_service_bus_management_client_enums.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_service_bus_management_client_enums.py similarity index 100% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/_service_bus_management_client_enums.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/models/_service_bus_management_client_enums.py diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py similarity index 100% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/__init__.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/__init__.py diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_disaster_recovery_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_disaster_recovery_configs_operations.py similarity index 93% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_disaster_recovery_configs_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_disaster_recovery_configs_operations.py index 2f8340c40a26..8da06faedcbd 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_disaster_recovery_configs_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_disaster_recovery_configs_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -28,8 +28,8 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +44,7 @@ def build_list_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,7 +77,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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -114,7 +114,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_break_pairing_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +216,7 @@ def build_fail_over_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -253,7 +253,7 @@ def build_list_authorization_rules_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -292,7 +292,7 @@ def build_get_authorization_rule_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,7 +334,7 @@ def build_list_keys_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -371,7 +371,7 @@ def build_check_name_availability_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -407,13 +407,13 @@ class DisasterRecoveryConfigsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`disaster_recovery_configs` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -421,12 +421,11 @@ def __init__(self, *args, **kwargs): ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.ArmDisasterRecovery"]: + ) -> ItemPaged["_models.ArmDisasterRecovery"]: """Gets all Alias(Disaster Recovery configurations). :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -434,14 +433,13 @@ def list( :param namespace_name: The namespace name. Required. :type namespace_name: str :return: An iterator like instance of either ArmDisasterRecovery or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.ArmDisasterRecovery] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ArmDisasterRecoveryListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -474,7 +472,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 ) @@ -517,7 +515,7 @@ def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Optional[_models.ArmDisasterRecovery]: + ) -> _models.ArmDisasterRecovery: """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -528,12 +526,12 @@ def create_or_update( :type alias: str :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery + :type parameters: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: ArmDisasterRecovery or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery or None + :return: ArmDisasterRecovery or the result of cls(response) + :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :raises ~azure.core.exceptions.HttpResponseError: """ @@ -547,7 +545,7 @@ def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> Optional[_models.ArmDisasterRecovery]: + ) -> _models.ArmDisasterRecovery: """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -562,8 +560,8 @@ def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: ArmDisasterRecovery or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery or None + :return: ArmDisasterRecovery or the result of cls(response) + :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :raises ~azure.core.exceptions.HttpResponseError: """ @@ -575,7 +573,7 @@ def create_or_update( alias: str, parameters: Union[_models.ArmDisasterRecovery, IO[bytes]], **kwargs: Any - ) -> Optional[_models.ArmDisasterRecovery]: + ) -> _models.ArmDisasterRecovery: """Creates or updates a new Alias(Disaster Recovery configuration). :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -586,9 +584,9 @@ def create_or_update( :type alias: str :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Is either a ArmDisasterRecovery type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery or IO[bytes] - :return: ArmDisasterRecovery or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery or None + :type parameters: ~azure.mgmt.servicebus.models.ArmDisasterRecovery or IO[bytes] + :return: ArmDisasterRecovery or the result of cls(response) + :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -602,9 +600,9 @@ def create_or_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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.ArmDisasterRecovery]] = kwargs.pop("cls", None) + cls: ClsType[_models.ArmDisasterRecovery] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -640,9 +638,7 @@ def create_or_update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize("ArmDisasterRecovery", pipeline_response.http_response) + deserialized = self._deserialize("ArmDisasterRecovery", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -676,7 +672,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -718,7 +714,7 @@ def get( :param alias: The Disaster Recovery configuration name. Required. :type alias: str :return: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery + :rtype: ~azure.mgmt.servicebus.models.ArmDisasterRecovery :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -732,7 +728,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ArmDisasterRecovery] = kwargs.pop("cls", None) _request = build_get_request( @@ -793,7 +789,7 @@ def break_pairing( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_break_pairing_request( @@ -843,7 +839,7 @@ def fail_over( :type alias: str :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Default value is None. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.FailoverProperties + :type parameters: ~azure.mgmt.servicebus.models.FailoverProperties :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -901,7 +897,7 @@ def fail_over( # pylint: disable=inconsistent-return-statements :type alias: str :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Is either a FailoverProperties type or a IO[bytes] type. Default value is None. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.FailoverProperties or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.FailoverProperties or IO[bytes] :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -917,7 +913,7 @@ def fail_over( # pylint: disable=inconsistent-return-statements _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -964,7 +960,7 @@ def fail_over( # pylint: disable=inconsistent-return-statements @distributed_trace def list_authorization_rules( self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any - ) -> Iterable["_models.SBAuthorizationRule"]: + ) -> ItemPaged["_models.SBAuthorizationRule"]: """Gets the authorization rules for a namespace. .. seealso:: @@ -977,14 +973,13 @@ def list_authorization_rules( :param alias: The Disaster Recovery configuration name. Required. :type alias: str :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1018,7 +1013,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 ) @@ -1069,7 +1064,7 @@ def get_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1083,7 +1078,7 @@ def get_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) _request = build_get_authorization_rule_request( @@ -1135,7 +1130,7 @@ def list_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1149,7 +1144,7 @@ def list_keys( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) _request = build_list_keys_request( @@ -1200,12 +1195,12 @@ def check_name_availability( :param namespace_name: The namespace name. Required. :type namespace_name: str :param parameters: Parameters to check availability of the given namespace name. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailability + :type parameters: ~azure.mgmt.servicebus.models.CheckNameAvailability :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1231,7 +1226,7 @@ def check_name_availability( Default value is "application/json". :paramtype content_type: str :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1251,9 +1246,9 @@ def check_name_availability( :type namespace_name: str :param parameters: Parameters to check availability of the given namespace name. Is either a CheckNameAvailability type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailability or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.CheckNameAvailability or IO[bytes] :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1267,7 +1262,7 @@ def check_name_availability( _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-11-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.CheckNameAvailabilityResult] = kwargs.pop("cls", None) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_migration_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_migration_configs_operations.py similarity index 93% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_migration_configs_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_migration_configs_operations.py index 870c86b918cc..abdeb9bd2154 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_migration_configs_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_migration_configs_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -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 @@ -32,8 +32,8 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_create_and_start_migration_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -126,7 +126,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -202,7 +202,7 @@ def build_complete_migration_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +240,7 @@ def build_revert_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,13 +274,13 @@ class MigrationConfigsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`migration_configs` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -288,12 +288,11 @@ def __init__(self, *args, **kwargs): ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.MigrationConfigProperties"]: + ) -> ItemPaged["_models.MigrationConfigProperties"]: """Gets all migrationConfigurations. :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -302,14 +301,13 @@ def list( :type namespace_name: str :return: An iterator like instance of either MigrationConfigProperties or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.MigrationConfigProperties] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MigrationConfigListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -342,7 +340,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 ) @@ -394,7 +392,7 @@ def _create_and_start_migration_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-11-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) @@ -463,16 +461,15 @@ def begin_create_and_start_migration( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :param parameters: Parameters required to create Migration Configuration. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties + :type parameters: ~azure.mgmt.servicebus.models.MigrationConfigProperties :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 MigrationConfigProperties or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.models.MigrationConfigProperties] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -495,7 +492,7 @@ def begin_create_and_start_migration( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :param parameters: Parameters required to create Migration Configuration. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -503,8 +500,7 @@ def begin_create_and_start_migration( :paramtype content_type: str :return: An instance of LROPoller that returns either MigrationConfigProperties or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.models.MigrationConfigProperties] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -525,21 +521,19 @@ def begin_create_and_start_migration( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :param parameters: Parameters required to create Migration Configuration. Is either a MigrationConfigProperties type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.MigrationConfigProperties or IO[bytes] :return: An instance of LROPoller that returns either MigrationConfigProperties or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.models.MigrationConfigProperties] :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-11-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.MigrationConfigProperties] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -599,7 +593,7 @@ def delete( # pylint: disable=inconsistent-return-statements :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -615,7 +609,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -659,9 +653,9 @@ def get( :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :return: MigrationConfigProperties or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties + :rtype: ~azure.mgmt.servicebus.models.MigrationConfigProperties :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -675,7 +669,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MigrationConfigProperties] = kwargs.pop("cls", None) _request = build_get_request( @@ -725,7 +719,7 @@ def complete_migration( # pylint: disable=inconsistent-return-statements :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -741,7 +735,7 @@ def complete_migration( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_complete_migration_request( @@ -785,7 +779,7 @@ def revert( # pylint: disable=inconsistent-return-statements :param namespace_name: The namespace name. Required. :type namespace_name: str :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or ~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigurationName + :type config_name: str or ~azure.mgmt.servicebus.models.MigrationConfigurationName :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -801,7 +795,7 @@ def revert( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_revert_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_namespaces_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_namespaces_operations.py similarity index 94% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_namespaces_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_namespaces_operations.py index 6f630833fb18..bf9a91ddc308 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_namespaces_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_namespaces_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -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 @@ -32,8 +32,8 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +46,7 @@ def build_list_request(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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -138,7 +138,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +171,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +204,7 @@ def build_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -240,7 +240,7 @@ def build_create_or_update_network_rule_set_request( # pylint: disable=name-too _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -276,7 +276,7 @@ def build_get_network_rule_set_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -309,7 +309,7 @@ def build_list_network_rule_sets_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +342,7 @@ def build_list_authorization_rules_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -375,7 +375,7 @@ def build_create_or_update_authorization_rule_request( # 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -414,7 +414,7 @@ def build_delete_authorization_rule_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -450,7 +450,7 @@ def build_get_authorization_rule_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -486,7 +486,7 @@ def build_list_keys_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -522,7 +522,7 @@ def build_regenerate_keys_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -559,7 +559,7 @@ def build_check_name_availability_request(subscription_id: str, **kwargs: Any) - _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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -590,13 +590,13 @@ class NamespacesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`namespaces` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -604,23 +604,22 @@ def __init__(self, *args, **kwargs): ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.SBNamespace"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.SBNamespace"]: """Gets all the available namespaces within the subscription, irrespective of the resource groups. .. seealso:: - https://msdn.microsoft.com/en-us/library/azure/mt639412.aspx :return: An iterator like instance of either SBNamespace or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.SBNamespace] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBNamespaceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -651,7 +650,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 ) @@ -685,7 +684,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.SBNamespace"]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.SBNamespace"]: """Gets the available namespaces within a resource group. .. seealso:: @@ -694,13 +693,13 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite :param resource_group_name: Name of the Resource group within the Azure subscription. Required. :type resource_group_name: str :return: An iterator like instance of either SBNamespace or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.SBNamespace] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBNamespaceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -732,7 +731,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 ) @@ -783,7 +782,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-11-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) @@ -853,13 +852,13 @@ def begin_create_or_update( :param namespace_name: The namespace name. Required. :type namespace_name: str :param parameters: Parameters supplied to create a namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace + :type parameters: ~azure.mgmt.servicebus.models.SBNamespace :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 SBNamespace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.models.SBNamespace] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -890,7 +889,7 @@ def begin_create_or_update( :paramtype content_type: str :return: An instance of LROPoller that returns either SBNamespace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.models.SBNamespace] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -914,16 +913,16 @@ def begin_create_or_update( :type namespace_name: str :param parameters: Parameters supplied to create a namespace resource. Is either a SBNamespace type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBNamespace or IO[bytes] :return: An instance of LROPoller that returns either SBNamespace or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.models.SBNamespace] :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-11-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.SBNamespace] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -979,7 +978,7 @@ def _delete_initial(self, resource_group_name: str, namespace_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-11-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( @@ -1035,7 +1034,7 @@ def begin_delete(self, resource_group_name: str, namespace_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-11-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) @@ -1084,7 +1083,7 @@ def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _ :param namespace_name: The namespace name. Required. :type namespace_name: str :return: SBNamespace or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace + :rtype: ~azure.mgmt.servicebus.models.SBNamespace :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1098,7 +1097,7 @@ def get(self, resource_group_name: str, namespace_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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBNamespace] = kwargs.pop("cls", None) _request = build_get_request( @@ -1148,12 +1147,12 @@ def update( :param namespace_name: The namespace name. Required. :type namespace_name: str :param parameters: Parameters supplied to update a namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespaceUpdateParameters + :type parameters: ~azure.mgmt.servicebus.models.SBNamespaceUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace or None + :rtype: ~azure.mgmt.servicebus.models.SBNamespace or None :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1180,7 +1179,7 @@ def update( Default value is "application/json". :paramtype content_type: str :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace or None + :rtype: ~azure.mgmt.servicebus.models.SBNamespace or None :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1201,10 +1200,9 @@ def update( :type namespace_name: str :param parameters: Parameters supplied to update a namespace resource. Is either a SBNamespaceUpdateParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespaceUpdateParameters or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBNamespaceUpdateParameters or IO[bytes] :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace or None + :rtype: ~azure.mgmt.servicebus.models.SBNamespace or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1218,7 +1216,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SBNamespace]] = kwargs.pop("cls", None) @@ -1280,12 +1278,12 @@ def create_or_update_network_rule_set( :param namespace_name: The namespace name. Required. :type namespace_name: str :param parameters: The Namespace IpFilterRule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :type parameters: ~azure.mgmt.servicebus.models.NetworkRuleSet :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1311,7 +1309,7 @@ def create_or_update_network_rule_set( Default value is "application/json". :paramtype content_type: str :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1331,9 +1329,9 @@ def create_or_update_network_rule_set( :type namespace_name: str :param parameters: The Namespace IpFilterRule. Is either a NetworkRuleSet type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.NetworkRuleSet or IO[bytes] :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1347,7 +1345,7 @@ def create_or_update_network_rule_set( _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-11-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.NetworkRuleSet] = kwargs.pop("cls", None) @@ -1402,7 +1400,7 @@ def get_network_rule_set( :param namespace_name: The namespace name. Required. :type namespace_name: str :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet + :rtype: ~azure.mgmt.servicebus.models.NetworkRuleSet :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1416,7 +1414,7 @@ def get_network_rule_set( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetworkRuleSet] = kwargs.pop("cls", None) _request = build_get_network_rule_set_request( @@ -1451,7 +1449,7 @@ def get_network_rule_set( @distributed_trace def list_network_rule_sets( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.NetworkRuleSet"]: + ) -> ItemPaged["_models.NetworkRuleSet"]: """Gets list of NetworkRuleSet for a Namespace. :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -1459,13 +1457,13 @@ def list_network_rule_sets( :param namespace_name: The namespace name. Required. :type namespace_name: str :return: An iterator like instance of either NetworkRuleSet or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.NetworkRuleSet] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.NetworkRuleSetListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1498,7 +1496,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 ) @@ -1534,7 +1532,7 @@ def get_next(next_link=None): @distributed_trace def list_authorization_rules( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.SBAuthorizationRule"]: + ) -> ItemPaged["_models.SBAuthorizationRule"]: """Gets the authorization rules for a namespace. .. seealso:: @@ -1545,14 +1543,13 @@ def list_authorization_rules( :param namespace_name: The namespace name. Required. :type namespace_name: str :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1585,7 +1582,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 ) @@ -1641,12 +1638,12 @@ def create_or_update_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1678,7 +1675,7 @@ def create_or_update_authorization_rule( Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1704,9 +1701,9 @@ def create_or_update_authorization_rule( :type authorization_rule_name: str :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule or IO[bytes] :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1720,7 +1717,7 @@ def create_or_update_authorization_rule( _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-11-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.SBAuthorizationRule] = kwargs.pop("cls", None) @@ -1795,7 +1792,7 @@ def delete_authorization_rule( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_authorization_rule_request( @@ -1840,7 +1837,7 @@ def get_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1854,7 +1851,7 @@ def get_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) _request = build_get_authorization_rule_request( @@ -1903,7 +1900,7 @@ def list_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1917,7 +1914,7 @@ def list_keys( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) _request = build_list_keys_request( @@ -1973,12 +1970,12 @@ def regenerate_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2010,7 +2007,7 @@ def regenerate_keys( Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2036,10 +2033,9 @@ def regenerate_keys( :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Is either a RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters or IO[bytes] :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2053,7 +2049,7 @@ def regenerate_keys( _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-11-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.AccessKeys] = kwargs.pop("cls", None) @@ -2105,12 +2101,12 @@ def check_name_availability( """Check the give namespace name availability. :param parameters: Parameters to check availability of the given namespace name. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailability + :type parameters: ~azure.mgmt.servicebus.models.CheckNameAvailability :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2126,7 +2122,7 @@ def check_name_availability( Default value is "application/json". :paramtype content_type: str :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2138,9 +2134,9 @@ def check_name_availability( :param parameters: Parameters to check availability of the given namespace name. Is either a CheckNameAvailability type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailability or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.CheckNameAvailability or IO[bytes] :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.CheckNameAvailabilityResult + :rtype: ~azure.mgmt.servicebus.models.CheckNameAvailabilityResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2154,7 +2150,7 @@ def check_name_availability( _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-11-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.CheckNameAvailabilityResult] = kwargs.pop("cls", None) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_operations.py similarity index 90% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_operations.py index 24dd8ed385b6..561cc4e61f3c 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core import PipelineClient @@ -26,8 +26,8 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,13 +61,13 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`operations` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -75,20 +75,19 @@ def __init__(self, *args, **kwargs): ) 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") - 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"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: """Lists all of the available ServiceBus REST API operations. :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.Operation] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -118,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 ) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_patch.py new file mode 100644 index 000000000000..8bcb627aa475 --- /dev/null +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_private_endpoint_connections_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_endpoint_connections_operations.py similarity index 94% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_private_endpoint_connections_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_endpoint_connections_operations.py index e44194df8a2b..114448dd61b7 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_endpoint_connections_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -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 @@ -32,8 +32,8 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +48,7 @@ def build_list_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -128,7 +128,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +168,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,13 +204,13 @@ class PrivateEndpointConnectionsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`private_endpoint_connections` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -218,12 +218,11 @@ def __init__(self, *args, **kwargs): ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.PrivateEndpointConnection"]: + ) -> ItemPaged["_models.PrivateEndpointConnection"]: """Gets the available PrivateEndpointConnections within a namespace. .. seealso:: @@ -235,14 +234,13 @@ def list( :type namespace_name: str :return: An iterator like instance of either PrivateEndpointConnection or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.PrivateEndpointConnection] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -275,7 +273,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 ) @@ -332,12 +330,12 @@ def create_or_update( :type private_endpoint_connection_name: str :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :type parameters: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -370,7 +368,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ @@ -396,10 +394,9 @@ def create_or_update( :type private_endpoint_connection_name: str :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to namespace resource. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.PrivateEndpointConnection or IO[bytes] :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -413,7 +410,7 @@ def create_or_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-11-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.PrivateEndpointConnection] = kwargs.pop("cls", None) @@ -472,7 +469,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-11-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( @@ -532,7 +529,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-11-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) @@ -586,7 +583,7 @@ def get( :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. :type private_endpoint_connection_name: str :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.servicebus.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -600,7 +597,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_private_link_resources_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_link_resources_operations.py similarity index 93% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_private_link_resources_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_link_resources_operations.py index 901d68f79be5..49f692e11d46 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_private_link_resources_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_private_link_resources_operations.py @@ -25,8 +25,8 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +41,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,13 +74,13 @@ class PrivateLinkResourcesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`private_link_resources` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -88,7 +88,6 @@ def __init__(self, *args, **kwargs): ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get( @@ -104,7 +103,7 @@ def get( :param namespace_name: The namespace name. Required. :type namespace_name: str :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateLinkResourcesListResult + :rtype: ~azure.mgmt.servicebus.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -118,7 +117,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_queues_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_queues_operations.py similarity index 95% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_queues_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_queues_operations.py index fec3220c906c..e762e288eee9 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_queues_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_queues_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -28,8 +28,8 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +44,7 @@ def build_list_authorization_rules_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_create_or_update_authorization_rule_request( # 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -128,7 +128,7 @@ def build_delete_authorization_rule_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +170,7 @@ def build_get_authorization_rule_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -212,7 +212,7 @@ def build_list_keys_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,7 +254,7 @@ def build_regenerate_keys_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -300,7 +300,7 @@ def build_list_by_namespace_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -337,7 +337,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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -374,7 +374,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +408,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -442,13 +442,13 @@ class QueuesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`queues` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -456,12 +456,11 @@ def __init__(self, *args, **kwargs): ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_authorization_rules( self, resource_group_name: str, namespace_name: str, queue_name: str, **kwargs: Any - ) -> Iterable["_models.SBAuthorizationRule"]: + ) -> ItemPaged["_models.SBAuthorizationRule"]: """Gets all authorization rules for a queue. .. seealso:: @@ -474,14 +473,13 @@ def list_authorization_rules( :param queue_name: The queue name. Required. :type queue_name: str :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -515,7 +513,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 ) @@ -571,12 +569,12 @@ def create_or_update_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -608,7 +606,7 @@ def create_or_update_authorization_rule( Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -634,9 +632,9 @@ def create_or_update_authorization_rule( :type authorization_rule_name: str :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule or IO[bytes] :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -650,7 +648,7 @@ def create_or_update_authorization_rule( _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-11-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.SBAuthorizationRule] = kwargs.pop("cls", None) @@ -733,7 +731,7 @@ def delete_authorization_rule( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_authorization_rule_request( @@ -786,7 +784,7 @@ def get_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -800,7 +798,7 @@ def get_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) _request = build_get_authorization_rule_request( @@ -857,7 +855,7 @@ def list_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -871,7 +869,7 @@ def list_keys( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) _request = build_list_keys_request( @@ -931,12 +929,12 @@ def regenerate_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -971,7 +969,7 @@ def regenerate_keys( Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1000,10 +998,9 @@ def regenerate_keys( :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Is either a RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters or IO[bytes] :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1017,7 +1014,7 @@ def regenerate_keys( _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-11-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.AccessKeys] = kwargs.pop("cls", None) @@ -1071,7 +1068,7 @@ def list_by_namespace( skip: Optional[int] = None, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.SBQueue"]: + ) -> ItemPaged["_models.SBQueue"]: """Gets the queues within a namespace. .. seealso:: @@ -1089,13 +1086,13 @@ def list_by_namespace( Default value is None. :type top: int :return: An iterator like instance of either SBQueue or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBQueue] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.SBQueue] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBQueueListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1130,7 +1127,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 ) @@ -1186,12 +1183,12 @@ def create_or_update( :param queue_name: The queue name. Required. :type queue_name: str :param parameters: Parameters supplied to create or update a queue resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :type parameters: ~azure.mgmt.servicebus.models.SBQueue :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :rtype: ~azure.mgmt.servicebus.models.SBQueue :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1223,7 +1220,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :rtype: ~azure.mgmt.servicebus.models.SBQueue :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1249,9 +1246,9 @@ def create_or_update( :type queue_name: str :param parameters: Parameters supplied to create or update a queue resource. Is either a SBQueue type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBQueue or IO[bytes] :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :rtype: ~azure.mgmt.servicebus.models.SBQueue :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1265,7 +1262,7 @@ def create_or_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-11-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.SBQueue] = kwargs.pop("cls", None) @@ -1340,7 +1337,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1383,7 +1380,7 @@ def get(self, resource_group_name: str, namespace_name: str, queue_name: str, ** :param queue_name: The queue name. Required. :type queue_name: str :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBQueue + :rtype: ~azure.mgmt.servicebus.models.SBQueue :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1397,7 +1394,7 @@ def get(self, resource_group_name: str, namespace_name: str, queue_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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBQueue] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_rules_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_rules_operations.py similarity index 95% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_rules_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_rules_operations.py index 172656b67571..ee9ebd276161 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_rules_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_rules_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -28,8 +28,8 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +52,7 @@ def build_list_by_subscriptions_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,7 +142,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +184,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,13 +220,13 @@ class RulesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`rules` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -234,7 +234,6 @@ def __init__(self, *args, **kwargs): ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_subscriptions( @@ -246,7 +245,7 @@ def list_by_subscriptions( skip: Optional[int] = None, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.Rule"]: + ) -> ItemPaged["_models.Rule"]: """List all the rules within given topic-subscription. :param resource_group_name: Name of the Resource group within the Azure subscription. Required. @@ -265,13 +264,13 @@ def list_by_subscriptions( Default value is None. :type top: int :return: An iterator like instance of either Rule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.Rule] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.Rule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -308,7 +307,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 ) @@ -367,12 +366,12 @@ def create_or_update( :param rule_name: The rule name. Required. :type rule_name: str :param parameters: Parameters supplied to create a rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :type parameters: ~azure.mgmt.servicebus.models.Rule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :rtype: ~azure.mgmt.servicebus.models.Rule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -407,7 +406,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :rtype: ~azure.mgmt.servicebus.models.Rule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -436,9 +435,9 @@ def create_or_update( :type rule_name: str :param parameters: Parameters supplied to create a rule. Is either a Rule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.Rule or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.Rule or IO[bytes] :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :rtype: ~azure.mgmt.servicebus.models.Rule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -452,7 +451,7 @@ def create_or_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-11-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.Rule] = kwargs.pop("cls", None) @@ -536,7 +535,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -590,7 +589,7 @@ def get( :param rule_name: The rule name. Required. :type rule_name: str :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.Rule + :rtype: ~azure.mgmt.servicebus.models.Rule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -604,7 +603,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Rule] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_subscriptions_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_subscriptions_operations.py similarity index 95% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_subscriptions_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_subscriptions_operations.py index f4053976d388..0929254dc689 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_subscriptions_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_subscriptions_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -28,8 +28,8 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +51,7 @@ def build_list_by_topic_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,7 +137,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +177,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -212,13 +212,13 @@ class SubscriptionsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`subscriptions` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -226,7 +226,6 @@ def __init__(self, *args, **kwargs): ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_topic( @@ -237,7 +236,7 @@ def list_by_topic( skip: Optional[int] = None, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.SBSubscription"]: + ) -> ItemPaged["_models.SBSubscription"]: """List all the subscriptions under a specified topic. .. seealso:: @@ -257,13 +256,13 @@ def list_by_topic( Default value is None. :type top: int :return: An iterator like instance of either SBSubscription or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.SBSubscription] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBSubscriptionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -299,7 +298,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 ) @@ -358,12 +357,12 @@ def create_or_update( :param subscription_name: The subscription name. Required. :type subscription_name: str :param parameters: Parameters supplied to create a subscription resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :type parameters: ~azure.mgmt.servicebus.models.SBSubscription :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :rtype: ~azure.mgmt.servicebus.models.SBSubscription :raises ~azure.core.exceptions.HttpResponseError: """ @@ -398,7 +397,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :rtype: ~azure.mgmt.servicebus.models.SBSubscription :raises ~azure.core.exceptions.HttpResponseError: """ @@ -427,9 +426,9 @@ def create_or_update( :type subscription_name: str :param parameters: Parameters supplied to create a subscription resource. Is either a SBSubscription type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBSubscription or IO[bytes] :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :rtype: ~azure.mgmt.servicebus.models.SBSubscription :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -443,7 +442,7 @@ def create_or_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-11-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.SBSubscription] = kwargs.pop("cls", None) @@ -521,7 +520,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -569,7 +568,7 @@ def get( :param subscription_name: The subscription name. Required. :type subscription_name: str :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription + :rtype: ~azure.mgmt.servicebus.models.SBSubscription :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -583,7 +582,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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBSubscription] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_topics_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_topics_operations.py similarity index 95% rename from sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_topics_operations.py rename to sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_topics_operations.py index 07f008eecc85..96aa88c9735f 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_topics_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/operations/_topics_operations.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core import PipelineClient @@ -28,8 +28,8 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from ..._serialization import Deserializer, Serializer from .._configuration import ServiceBusManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +44,7 @@ def build_list_authorization_rules_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_create_or_update_authorization_rule_request( # 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -128,7 +128,7 @@ def build_get_authorization_rule_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +170,7 @@ def build_delete_authorization_rule_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -212,7 +212,7 @@ def build_list_keys_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,7 +254,7 @@ def build_regenerate_keys_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -300,7 +300,7 @@ def build_list_by_namespace_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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -337,7 +337,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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -374,7 +374,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +408,7 @@ 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", "2021-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -442,13 +442,13 @@ class TopicsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2021_11_01.ServiceBusManagementClient`'s + :class:`~azure.mgmt.servicebus.ServiceBusManagementClient`'s :attr:`topics` attribute. """ models = _models - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: ServiceBusManagementClientConfiguration = ( @@ -456,12 +456,11 @@ def __init__(self, *args, **kwargs): ) 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_authorization_rules( self, resource_group_name: str, namespace_name: str, topic_name: str, **kwargs: Any - ) -> Iterable["_models.SBAuthorizationRule"]: + ) -> ItemPaged["_models.SBAuthorizationRule"]: """Gets authorization rules for a topic. .. seealso:: @@ -474,14 +473,13 @@ def list_authorization_rules( :param topic_name: The topic name. Required. :type topic_name: str :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.SBAuthorizationRule] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -515,7 +513,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 ) @@ -574,12 +572,12 @@ def create_or_update_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -614,7 +612,7 @@ def create_or_update_authorization_rule( Default value is "application/json". :paramtype content_type: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ @@ -643,9 +641,9 @@ def create_or_update_authorization_rule( :type authorization_rule_name: str :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBAuthorizationRule or IO[bytes] :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -659,7 +657,7 @@ def create_or_update_authorization_rule( _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-11-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.SBAuthorizationRule] = kwargs.pop("cls", None) @@ -728,7 +726,7 @@ def get_authorization_rule( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule + :rtype: ~azure.mgmt.servicebus.models.SBAuthorizationRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -742,7 +740,7 @@ def get_authorization_rule( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) _request = build_get_authorization_rule_request( @@ -813,7 +811,7 @@ def delete_authorization_rule( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_authorization_rule_request( @@ -866,7 +864,7 @@ def list_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -880,7 +878,7 @@ def list_keys( _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) _request = build_list_keys_request( @@ -940,12 +938,12 @@ def regenerate_keys( :param authorization_rule_name: The authorization rule name. Required. :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -980,7 +978,7 @@ def regenerate_keys( Default value is "application/json". :paramtype content_type: str :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1009,10 +1007,9 @@ def regenerate_keys( :type authorization_rule_name: str :param parameters: Parameters supplied to regenerate the authorization rule. Is either a RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.RegenerateAccessKeyParameters or - IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.RegenerateAccessKeyParameters or IO[bytes] :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.AccessKeys + :rtype: ~azure.mgmt.servicebus.models.AccessKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1026,7 +1023,7 @@ def regenerate_keys( _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-11-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.AccessKeys] = kwargs.pop("cls", None) @@ -1080,7 +1077,7 @@ def list_by_namespace( skip: Optional[int] = None, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.SBTopic"]: + ) -> ItemPaged["_models.SBTopic"]: """Gets all the topics in a namespace. .. seealso:: @@ -1098,13 +1095,13 @@ def list_by_namespace( Default value is None. :type top: int :return: An iterator like instance of either SBTopic or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2021_11_01.models.SBTopic] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.models.SBTopic] :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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBTopicListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1139,7 +1136,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 ) @@ -1195,12 +1192,12 @@ def create_or_update( :param topic_name: The topic name. Required. :type topic_name: str :param parameters: Parameters supplied to create a topic resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :type parameters: ~azure.mgmt.servicebus.models.SBTopic :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :rtype: ~azure.mgmt.servicebus.models.SBTopic :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1232,7 +1229,7 @@ def create_or_update( Default value is "application/json". :paramtype content_type: str :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :rtype: ~azure.mgmt.servicebus.models.SBTopic :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1258,9 +1255,9 @@ def create_or_update( :type topic_name: str :param parameters: Parameters supplied to create a topic resource. Is either a SBTopic type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic or IO[bytes] + :type parameters: ~azure.mgmt.servicebus.models.SBTopic or IO[bytes] :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :rtype: ~azure.mgmt.servicebus.models.SBTopic :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1274,7 +1271,7 @@ def create_or_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-11-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.SBTopic] = kwargs.pop("cls", None) @@ -1349,7 +1346,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) 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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1392,7 +1389,7 @@ def get(self, resource_group_name: str, namespace_name: str, topic_name: str, ** :param topic_name: The topic name. Required. :type topic_name: str :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2021_11_01.models.SBTopic + :rtype: ~azure.mgmt.servicebus.models.SBTopic :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1406,7 +1403,7 @@ def get(self, resource_group_name: str, namespace_name: str, topic_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-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SBTopic] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/__init__.py deleted file mode 100644 index d4f6b2f73883..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_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 ._service_bus_management_client import ServiceBusManagementClient # 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__ = [ - "ServiceBusManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_configuration.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_configuration.py deleted file mode 100644 index b42637ee1c69..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_configuration.py +++ /dev/null @@ -1,65 +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 ServiceBusManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for ServiceBusManagementClient. - - 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: Subscription credentials that uniquely identify a Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-11-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", "2021-11-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-servicebus/{}".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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_metadata.json b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_metadata.json deleted file mode 100644 index 95ed4cd05e3b..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_metadata.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "chosen_version": "2021-11-01", - "total_api_version_list": ["2021-11-01"], - "client": { - "name": "ServiceBusManagementClient", - "filename": "_service_bus_management_client", - "description": "Azure Service Bus client for managing Namespace.", - "host_value": null, - "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.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ServiceBusManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"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.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ServiceBusManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"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": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. 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": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. 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: Optional[str] = None,", - "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: Optional[str] = None,", - "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": { - "namespaces": "NamespacesOperations", - "private_endpoint_connections": "PrivateEndpointConnectionsOperations", - "private_link_resources": "PrivateLinkResourcesOperations", - "operations": "Operations", - "disaster_recovery_configs": "DisasterRecoveryConfigsOperations", - "migration_configs": "MigrationConfigsOperations", - "queues": "QueuesOperations", - "topics": "TopicsOperations", - "rules": "RulesOperations", - "subscriptions": "SubscriptionsOperations" - } -} diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_service_bus_management_client.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_service_bus_management_client.py deleted file mode 100644 index a41720ae2708..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/_service_bus_management_client.py +++ /dev/null @@ -1,170 +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, 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.mgmt.core.tools import get_arm_endpoints - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import ServiceBusManagementClientConfiguration -from .operations import ( - DisasterRecoveryConfigsOperations, - MigrationConfigsOperations, - NamespacesOperations, - Operations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QueuesOperations, - RulesOperations, - SubscriptionsOperations, - TopicsOperations, -) - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class ServiceBusManagementClient: # pylint: disable=too-many-instance-attributes - """Azure Service Bus client for managing Namespace. - - :ivar namespaces: NamespacesOperations operations - :vartype namespaces: azure.mgmt.servicebus.v2021_11_01.operations.NamespacesOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.servicebus.v2021_11_01.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.servicebus.v2021_11_01.operations.PrivateLinkResourcesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.servicebus.v2021_11_01.operations.Operations - :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations - :vartype disaster_recovery_configs: - azure.mgmt.servicebus.v2021_11_01.operations.DisasterRecoveryConfigsOperations - :ivar migration_configs: MigrationConfigsOperations operations - :vartype migration_configs: - azure.mgmt.servicebus.v2021_11_01.operations.MigrationConfigsOperations - :ivar queues: QueuesOperations operations - :vartype queues: azure.mgmt.servicebus.v2021_11_01.operations.QueuesOperations - :ivar topics: TopicsOperations operations - :vartype topics: azure.mgmt.servicebus.v2021_11_01.operations.TopicsOperations - :ivar rules: RulesOperations operations - :vartype rules: azure.mgmt.servicebus.v2021_11_01.operations.RulesOperations - :ivar subscriptions: SubscriptionsOperations operations - :vartype subscriptions: azure.mgmt.servicebus.v2021_11_01.operations.SubscriptionsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is None. - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-11-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: 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 = ServiceBusManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs - ) - - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - ARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, 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.namespaces = NamespacesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2021-11-01") - self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.migration_configs = MigrationConfigsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.queues = QueuesOperations(self._client, self._config, self._serialize, self._deserialize, "2021-11-01") - self.topics = TopicsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-11-01") - self.rules = RulesOperations(self._client, self._config, self._serialize, self._deserialize, "2021-11-01") - self.subscriptions = SubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/__init__.py deleted file mode 100644 index 39948e536385..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_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 ._service_bus_management_client import ServiceBusManagementClient # 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__ = [ - "ServiceBusManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_configuration.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_configuration.py deleted file mode 100644 index 8062aee4f9d1..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_configuration.py +++ /dev/null @@ -1,65 +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 ServiceBusManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for ServiceBusManagementClient. - - 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: Subscription credentials that uniquely identify a Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2021-11-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", "2021-11-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-servicebus/{}".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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_service_bus_management_client.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_service_bus_management_client.py deleted file mode 100644 index 77e90dcff12e..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/aio/_service_bus_management_client.py +++ /dev/null @@ -1,175 +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, 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.mgmt.core.tools import get_arm_endpoints - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import ServiceBusManagementClientConfiguration -from .operations import ( - DisasterRecoveryConfigsOperations, - MigrationConfigsOperations, - NamespacesOperations, - Operations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QueuesOperations, - RulesOperations, - SubscriptionsOperations, - TopicsOperations, -) - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class ServiceBusManagementClient: # pylint: disable=too-many-instance-attributes - """Azure Service Bus client for managing Namespace. - - :ivar namespaces: NamespacesOperations operations - :vartype namespaces: azure.mgmt.servicebus.v2021_11_01.aio.operations.NamespacesOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.servicebus.v2021_11_01.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.servicebus.v2021_11_01.aio.operations.PrivateLinkResourcesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.servicebus.v2021_11_01.aio.operations.Operations - :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations - :vartype disaster_recovery_configs: - azure.mgmt.servicebus.v2021_11_01.aio.operations.DisasterRecoveryConfigsOperations - :ivar migration_configs: MigrationConfigsOperations operations - :vartype migration_configs: - azure.mgmt.servicebus.v2021_11_01.aio.operations.MigrationConfigsOperations - :ivar queues: QueuesOperations operations - :vartype queues: azure.mgmt.servicebus.v2021_11_01.aio.operations.QueuesOperations - :ivar topics: TopicsOperations operations - :vartype topics: azure.mgmt.servicebus.v2021_11_01.aio.operations.TopicsOperations - :ivar rules: RulesOperations operations - :vartype rules: azure.mgmt.servicebus.v2021_11_01.aio.operations.RulesOperations - :ivar subscriptions: SubscriptionsOperations operations - :vartype subscriptions: - azure.mgmt.servicebus.v2021_11_01.aio.operations.SubscriptionsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is None. - :type base_url: str - :keyword api_version: Api Version. Default value is "2021-11-01". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **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 = ServiceBusManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs - ) - - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - AsyncARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( - base_url=cast(str, 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.namespaces = NamespacesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2021-11-01") - self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.migration_configs = MigrationConfigsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-01" - ) - self.queues = QueuesOperations(self._client, self._config, self._serialize, self._deserialize, "2021-11-01") - self.topics = TopicsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-11-01") - self.rules = RulesOperations(self._client, self._config, self._serialize, self._deserialize, "2021-11-01") - self.subscriptions = SubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2021-11-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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/__init__.py deleted file mode 100644 index 1fa1caae20bb..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/__init__.py +++ /dev/null @@ -1,174 +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 - AccessKeys, - Action, - ArmDisasterRecovery, - ArmDisasterRecoveryListResult, - CheckNameAvailability, - CheckNameAvailabilityResult, - ConnectionState, - CorrelationFilter, - Encryption, - ErrorAdditionalInfo, - ErrorResponse, - ErrorResponseError, - FailoverProperties, - Identity, - KeyVaultProperties, - MessageCountDetails, - MigrationConfigListResult, - MigrationConfigProperties, - NWRuleSetIpRules, - NWRuleSetVirtualNetworkRules, - NetworkRuleSet, - NetworkRuleSetListResult, - Operation, - OperationDisplay, - OperationListResult, - PrivateEndpoint, - PrivateEndpointConnection, - PrivateEndpointConnectionListResult, - PrivateLinkResource, - PrivateLinkResourcesListResult, - ProxyResource, - RegenerateAccessKeyParameters, - Resource, - ResourceNamespacePatch, - Rule, - RuleListResult, - SBAuthorizationRule, - SBAuthorizationRuleListResult, - SBClientAffineProperties, - SBNamespace, - SBNamespaceListResult, - SBNamespaceUpdateParameters, - SBQueue, - SBQueueListResult, - SBSku, - SBSubscription, - SBSubscriptionListResult, - SBTopic, - SBTopicListResult, - SqlFilter, - SqlRuleAction, - Subnet, - SystemData, - TrackedResource, - UserAssignedIdentity, - UserAssignedIdentityProperties, -) - -from ._service_bus_management_client_enums import ( # type: ignore - AccessRights, - CreatedByType, - DefaultAction, - EndPointProvisioningState, - EntityStatus, - FilterType, - KeyType, - ManagedServiceIdentityType, - MigrationConfigurationName, - NetworkRuleIPAction, - PrivateLinkConnectionStatus, - ProvisioningStateDR, - PublicNetworkAccessFlag, - RoleDisasterRecovery, - SkuName, - SkuTier, - UnavailableReason, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AccessKeys", - "Action", - "ArmDisasterRecovery", - "ArmDisasterRecoveryListResult", - "CheckNameAvailability", - "CheckNameAvailabilityResult", - "ConnectionState", - "CorrelationFilter", - "Encryption", - "ErrorAdditionalInfo", - "ErrorResponse", - "ErrorResponseError", - "FailoverProperties", - "Identity", - "KeyVaultProperties", - "MessageCountDetails", - "MigrationConfigListResult", - "MigrationConfigProperties", - "NWRuleSetIpRules", - "NWRuleSetVirtualNetworkRules", - "NetworkRuleSet", - "NetworkRuleSetListResult", - "Operation", - "OperationDisplay", - "OperationListResult", - "PrivateEndpoint", - "PrivateEndpointConnection", - "PrivateEndpointConnectionListResult", - "PrivateLinkResource", - "PrivateLinkResourcesListResult", - "ProxyResource", - "RegenerateAccessKeyParameters", - "Resource", - "ResourceNamespacePatch", - "Rule", - "RuleListResult", - "SBAuthorizationRule", - "SBAuthorizationRuleListResult", - "SBClientAffineProperties", - "SBNamespace", - "SBNamespaceListResult", - "SBNamespaceUpdateParameters", - "SBQueue", - "SBQueueListResult", - "SBSku", - "SBSubscription", - "SBSubscriptionListResult", - "SBTopic", - "SBTopicListResult", - "SqlFilter", - "SqlRuleAction", - "Subnet", - "SystemData", - "TrackedResource", - "UserAssignedIdentity", - "UserAssignedIdentityProperties", - "AccessRights", - "CreatedByType", - "DefaultAction", - "EndPointProvisioningState", - "EntityStatus", - "FilterType", - "KeyType", - "ManagedServiceIdentityType", - "MigrationConfigurationName", - "NetworkRuleIPAction", - "PrivateLinkConnectionStatus", - "ProvisioningStateDR", - "PublicNetworkAccessFlag", - "RoleDisasterRecovery", - "SkuName", - "SkuTier", - "UnavailableReason", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_models_py3.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_models_py3.py deleted file mode 100644 index e9a049a74528..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_models_py3.py +++ /dev/null @@ -1,3046 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from collections.abc import MutableMapping -import datetime -from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union - -from ... import _serialization - -if TYPE_CHECKING: - from .. import models as _models -JSON = MutableMapping[str, Any] - - -class AccessKeys(_serialization.Model): - """Namespace/ServiceBus Connection String. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar primary_connection_string: Primary connection string of the created namespace - authorization rule. - :vartype primary_connection_string: str - :ivar secondary_connection_string: Secondary connection string of the created namespace - authorization rule. - :vartype secondary_connection_string: str - :ivar alias_primary_connection_string: Primary connection string of the alias if GEO DR is - enabled. - :vartype alias_primary_connection_string: str - :ivar alias_secondary_connection_string: Secondary connection string of the alias if GEO DR is - enabled. - :vartype alias_secondary_connection_string: str - :ivar primary_key: A base64-encoded 256-bit primary key for signing and validating the SAS - token. - :vartype primary_key: str - :ivar secondary_key: A base64-encoded 256-bit primary key for signing and validating the SAS - token. - :vartype secondary_key: str - :ivar key_name: A string that describes the authorization rule. - :vartype key_name: str - """ - - _validation = { - "primary_connection_string": {"readonly": True}, - "secondary_connection_string": {"readonly": True}, - "alias_primary_connection_string": {"readonly": True}, - "alias_secondary_connection_string": {"readonly": True}, - "primary_key": {"readonly": True}, - "secondary_key": {"readonly": True}, - "key_name": {"readonly": True}, - } - - _attribute_map = { - "primary_connection_string": {"key": "primaryConnectionString", "type": "str"}, - "secondary_connection_string": {"key": "secondaryConnectionString", "type": "str"}, - "alias_primary_connection_string": {"key": "aliasPrimaryConnectionString", "type": "str"}, - "alias_secondary_connection_string": {"key": "aliasSecondaryConnectionString", "type": "str"}, - "primary_key": {"key": "primaryKey", "type": "str"}, - "secondary_key": {"key": "secondaryKey", "type": "str"}, - "key_name": {"key": "keyName", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.primary_connection_string: Optional[str] = None - self.secondary_connection_string: Optional[str] = None - self.alias_primary_connection_string: Optional[str] = None - self.alias_secondary_connection_string: Optional[str] = None - self.primary_key: Optional[str] = None - self.secondary_key: Optional[str] = None - self.key_name: Optional[str] = None - - -class Action(_serialization.Model): - """Represents the filter actions which are allowed for the transformation of a message that have - been matched by a filter expression. - - :ivar sql_expression: SQL expression. e.g. MyProperty='ABC'. - :vartype sql_expression: str - :ivar compatibility_level: This property is reserved for future use. An integer value showing - the compatibility level, currently hard-coded to 20. - :vartype compatibility_level: int - :ivar requires_preprocessing: Value that indicates whether the rule action requires - preprocessing. - :vartype requires_preprocessing: bool - """ - - _attribute_map = { - "sql_expression": {"key": "sqlExpression", "type": "str"}, - "compatibility_level": {"key": "compatibilityLevel", "type": "int"}, - "requires_preprocessing": {"key": "requiresPreprocessing", "type": "bool"}, - } - - def __init__( - self, - *, - sql_expression: Optional[str] = None, - compatibility_level: Optional[int] = None, - requires_preprocessing: bool = True, - **kwargs: Any - ) -> None: - """ - :keyword sql_expression: SQL expression. e.g. MyProperty='ABC'. - :paramtype sql_expression: str - :keyword compatibility_level: This property is reserved for future use. An integer value - showing the compatibility level, currently hard-coded to 20. - :paramtype compatibility_level: int - :keyword requires_preprocessing: Value that indicates whether the rule action requires - preprocessing. - :paramtype requires_preprocessing: bool - """ - super().__init__(**kwargs) - self.sql_expression = sql_expression - self.compatibility_level = compatibility_level - self.requires_preprocessing = requires_preprocessing - - -class ProxyResource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - self.location: Optional[str] = None - - -class ArmDisasterRecovery(ProxyResource): - """Single item in List or Get Alias(Disaster Recovery configuration) operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar provisioning_state: Provisioning state of the Alias(Disaster Recovery configuration) - - possible values 'Accepted' or 'Succeeded' or 'Failed'. Known values are: "Accepted", - "Succeeded", and "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.servicebus.v2021_11_01.models.ProvisioningStateDR - :ivar pending_replication_operations_count: Number of entities pending to be replicated. - :vartype pending_replication_operations_count: int - :ivar partner_namespace: ARM Id of the Primary/Secondary eventhub namespace name, which is part - of GEO DR pairing. - :vartype partner_namespace: str - :ivar alternate_name: Primary/Secondary eventhub namespace name, which is part of GEO DR - pairing. - :vartype alternate_name: str - :ivar role: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' - or 'Secondary'. Known values are: "Primary", "PrimaryNotReplicating", and "Secondary". - :vartype role: str or ~azure.mgmt.servicebus.v2021_11_01.models.RoleDisasterRecovery - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "pending_replication_operations_count": {"readonly": True}, - "role": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "pending_replication_operations_count": {"key": "properties.pendingReplicationOperationsCount", "type": "int"}, - "partner_namespace": {"key": "properties.partnerNamespace", "type": "str"}, - "alternate_name": {"key": "properties.alternateName", "type": "str"}, - "role": {"key": "properties.role", "type": "str"}, - } - - def __init__( - self, *, partner_namespace: Optional[str] = None, alternate_name: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword partner_namespace: ARM Id of the Primary/Secondary eventhub namespace name, which is - part of GEO DR pairing. - :paramtype partner_namespace: str - :keyword alternate_name: Primary/Secondary eventhub namespace name, which is part of GEO DR - pairing. - :paramtype alternate_name: str - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.provisioning_state: Optional[Union[str, "_models.ProvisioningStateDR"]] = None - self.pending_replication_operations_count: Optional[int] = None - self.partner_namespace = partner_namespace - self.alternate_name = alternate_name - self.role: Optional[Union[str, "_models.RoleDisasterRecovery"]] = None - - -class ArmDisasterRecoveryListResult(_serialization.Model): - """The result of the List Alias(Disaster Recovery configuration) operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Alias(Disaster Recovery configurations). - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery] - :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list - of Alias(Disaster Recovery configuration). - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ArmDisasterRecovery]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.ArmDisasterRecovery"]] = None, **kwargs: Any) -> None: - """ - :keyword value: List of Alias(Disaster Recovery configurations). - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.ArmDisasterRecovery] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class CheckNameAvailability(_serialization.Model): - """Description of a Check Name availability request properties. - - All required parameters must be populated in order to send to server. - - :ivar name: The Name to check the namespace name availability and The namespace name can - contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must - end with a letter or number. Required. - :vartype name: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - } - - def __init__(self, *, name: str, **kwargs: Any) -> None: - """ - :keyword name: The Name to check the namespace name availability and The namespace name can - contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must - end with a letter or number. Required. - :paramtype name: str - """ - super().__init__(**kwargs) - self.name = name - - -class CheckNameAvailabilityResult(_serialization.Model): - """Description of a Check Name availability request properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar message: The detailed info regarding the reason associated with the namespace. - :vartype message: str - :ivar name_available: Value indicating namespace is availability, true if the namespace is - available; otherwise, false. - :vartype name_available: bool - :ivar reason: The reason for unavailability of a namespace. Known values are: "None", - "InvalidName", "SubscriptionIsDisabled", "NameInUse", "NameInLockdown", and - "TooManyNamespaceInCurrentSubscription". - :vartype reason: str or ~azure.mgmt.servicebus.v2021_11_01.models.UnavailableReason - """ - - _validation = { - "message": {"readonly": True}, - } - - _attribute_map = { - "message": {"key": "message", "type": "str"}, - "name_available": {"key": "nameAvailable", "type": "bool"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__( - self, - *, - name_available: Optional[bool] = None, - reason: Optional[Union[str, "_models.UnavailableReason"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name_available: Value indicating namespace is availability, true if the namespace is - available; otherwise, false. - :paramtype name_available: bool - :keyword reason: The reason for unavailability of a namespace. Known values are: "None", - "InvalidName", "SubscriptionIsDisabled", "NameInUse", "NameInLockdown", and - "TooManyNamespaceInCurrentSubscription". - :paramtype reason: str or ~azure.mgmt.servicebus.v2021_11_01.models.UnavailableReason - """ - super().__init__(**kwargs) - self.message: Optional[str] = None - self.name_available = name_available - self.reason = reason - - -class ConnectionState(_serialization.Model): - """ConnectionState information. - - :ivar status: Status of the connection. Known values are: "Pending", "Approved", "Rejected", - and "Disconnected". - :vartype status: str or ~azure.mgmt.servicebus.v2021_11_01.models.PrivateLinkConnectionStatus - :ivar description: Description of the connection state. - :vartype description: str - """ - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "_models.PrivateLinkConnectionStatus"]] = None, - description: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword status: Status of the connection. Known values are: "Pending", "Approved", "Rejected", - and "Disconnected". - :paramtype status: str or ~azure.mgmt.servicebus.v2021_11_01.models.PrivateLinkConnectionStatus - :keyword description: Description of the connection state. - :paramtype description: str - """ - super().__init__(**kwargs) - self.status = status - self.description = description - - -class CorrelationFilter(_serialization.Model): - """Represents the correlation filter expression. - - :ivar properties: dictionary object for custom filters. - :vartype properties: dict[str, str] - :ivar correlation_id: Identifier of the correlation. - :vartype correlation_id: str - :ivar message_id: Identifier of the message. - :vartype message_id: str - :ivar to: Address to send to. - :vartype to: str - :ivar reply_to: Address of the queue to reply to. - :vartype reply_to: str - :ivar label: Application specific label. - :vartype label: str - :ivar session_id: Session identifier. - :vartype session_id: str - :ivar reply_to_session_id: Session identifier to reply to. - :vartype reply_to_session_id: str - :ivar content_type: Content type of the message. - :vartype content_type: str - :ivar requires_preprocessing: Value that indicates whether the rule action requires - preprocessing. - :vartype requires_preprocessing: bool - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "{str}"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "message_id": {"key": "messageId", "type": "str"}, - "to": {"key": "to", "type": "str"}, - "reply_to": {"key": "replyTo", "type": "str"}, - "label": {"key": "label", "type": "str"}, - "session_id": {"key": "sessionId", "type": "str"}, - "reply_to_session_id": {"key": "replyToSessionId", "type": "str"}, - "content_type": {"key": "contentType", "type": "str"}, - "requires_preprocessing": {"key": "requiresPreprocessing", "type": "bool"}, - } - - def __init__( - self, - *, - properties: Optional[Dict[str, str]] = None, - correlation_id: Optional[str] = None, - message_id: Optional[str] = None, - to: Optional[str] = None, - reply_to: Optional[str] = None, - label: Optional[str] = None, - session_id: Optional[str] = None, - reply_to_session_id: Optional[str] = None, - content_type: Optional[str] = None, - requires_preprocessing: bool = True, - **kwargs: Any - ) -> None: - """ - :keyword properties: dictionary object for custom filters. - :paramtype properties: dict[str, str] - :keyword correlation_id: Identifier of the correlation. - :paramtype correlation_id: str - :keyword message_id: Identifier of the message. - :paramtype message_id: str - :keyword to: Address to send to. - :paramtype to: str - :keyword reply_to: Address of the queue to reply to. - :paramtype reply_to: str - :keyword label: Application specific label. - :paramtype label: str - :keyword session_id: Session identifier. - :paramtype session_id: str - :keyword reply_to_session_id: Session identifier to reply to. - :paramtype reply_to_session_id: str - :keyword content_type: Content type of the message. - :paramtype content_type: str - :keyword requires_preprocessing: Value that indicates whether the rule action requires - preprocessing. - :paramtype requires_preprocessing: bool - """ - super().__init__(**kwargs) - self.properties = properties - self.correlation_id = correlation_id - self.message_id = message_id - self.to = to - self.reply_to = reply_to - self.label = label - self.session_id = session_id - self.reply_to_session_id = reply_to_session_id - self.content_type = content_type - self.requires_preprocessing = requires_preprocessing - - -class Encryption(_serialization.Model): - """Properties to configure Encryption. - - :ivar key_vault_properties: Properties of KeyVault. - :vartype key_vault_properties: - list[~azure.mgmt.servicebus.v2021_11_01.models.KeyVaultProperties] - :ivar key_source: Enumerates the possible value of keySource for Encryption. Default value is - "Microsoft.KeyVault". - :vartype key_source: str - :ivar require_infrastructure_encryption: Enable Infrastructure Encryption (Double Encryption). - :vartype require_infrastructure_encryption: bool - """ - - _attribute_map = { - "key_vault_properties": {"key": "keyVaultProperties", "type": "[KeyVaultProperties]"}, - "key_source": {"key": "keySource", "type": "str"}, - "require_infrastructure_encryption": {"key": "requireInfrastructureEncryption", "type": "bool"}, - } - - def __init__( - self, - *, - key_vault_properties: Optional[List["_models.KeyVaultProperties"]] = None, - key_source: Literal["Microsoft.KeyVault"] = "Microsoft.KeyVault", - require_infrastructure_encryption: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword key_vault_properties: Properties of KeyVault. - :paramtype key_vault_properties: - list[~azure.mgmt.servicebus.v2021_11_01.models.KeyVaultProperties] - :keyword key_source: Enumerates the possible value of keySource for Encryption. Default value - is "Microsoft.KeyVault". - :paramtype key_source: str - :keyword require_infrastructure_encryption: Enable Infrastructure Encryption (Double - Encryption). - :paramtype require_infrastructure_encryption: bool - """ - super().__init__(**kwargs) - self.key_vault_properties = key_vault_properties - self.key_source = key_source - self.require_infrastructure_encryption = require_infrastructure_encryption - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type: Optional[str] = None - self.info: Optional[JSON] = None - - -class ErrorResponse(_serialization.Model): - """The resource management error response. - - :ivar error: The error object. - :vartype error: ~azure.mgmt.servicebus.v2021_11_01.models.ErrorResponseError - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorResponseError"}, - } - - def __init__(self, *, error: Optional["_models.ErrorResponseError"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.servicebus.v2021_11_01.models.ErrorResponseError - """ - super().__init__(**kwargs) - self.error = error - - -class ErrorResponseError(_serialization.Model): - """The error object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.servicebus.v2021_11_01.models.ErrorResponse] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.servicebus.v2021_11_01.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorResponse]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code: Optional[str] = None - self.message: Optional[str] = None - self.target: Optional[str] = None - self.details: Optional[List["_models.ErrorResponse"]] = None - self.additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = None - - -class FailoverProperties(_serialization.Model): - """Safe failover is to indicate the service should wait for pending replication to finish before - switching to the secondary. - - :ivar is_safe_failover: Safe failover is to indicate the service should wait for pending - replication to finish before switching to the secondary. - :vartype is_safe_failover: bool - """ - - _attribute_map = { - "is_safe_failover": {"key": "properties.IsSafeFailover", "type": "bool"}, - } - - def __init__(self, *, is_safe_failover: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword is_safe_failover: Safe failover is to indicate the service should wait for pending - replication to finish before switching to the secondary. - :paramtype is_safe_failover: bool - """ - super().__init__(**kwargs) - self.is_safe_failover = is_safe_failover - - -class Identity(_serialization.Model): - """Properties to configure User Assigned Identities for Bring your Own Keys. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: ObjectId from the KeyVault. - :vartype principal_id: str - :ivar tenant_id: TenantId from the KeyVault. - :vartype tenant_id: str - :ivar type: Type of managed service identity. Known values are: "SystemAssigned", - "UserAssigned", "SystemAssigned, UserAssigned", and "None". - :vartype type: str or ~azure.mgmt.servicebus.v2021_11_01.models.ManagedServiceIdentityType - :ivar user_assigned_identities: Properties for User Assigned Identities. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.servicebus.v2021_11_01.models.UserAssignedIdentity] - """ - - _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: Type of managed service identity. Known values are: "SystemAssigned", - "UserAssigned", "SystemAssigned, UserAssigned", and "None". - :paramtype type: str or ~azure.mgmt.servicebus.v2021_11_01.models.ManagedServiceIdentityType - :keyword user_assigned_identities: Properties for User Assigned Identities. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.servicebus.v2021_11_01.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.principal_id: Optional[str] = None - self.tenant_id: Optional[str] = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class KeyVaultProperties(_serialization.Model): - """Properties to configure keyVault Properties. - - :ivar key_name: Name of the Key from KeyVault. - :vartype key_name: str - :ivar key_vault_uri: Uri of KeyVault. - :vartype key_vault_uri: str - :ivar key_version: Version of KeyVault. - :vartype key_version: str - :ivar identity: - :vartype identity: ~azure.mgmt.servicebus.v2021_11_01.models.UserAssignedIdentityProperties - """ - - _attribute_map = { - "key_name": {"key": "keyName", "type": "str"}, - "key_vault_uri": {"key": "keyVaultUri", "type": "str"}, - "key_version": {"key": "keyVersion", "type": "str"}, - "identity": {"key": "identity", "type": "UserAssignedIdentityProperties"}, - } - - def __init__( - self, - *, - key_name: Optional[str] = None, - key_vault_uri: Optional[str] = None, - key_version: Optional[str] = None, - identity: Optional["_models.UserAssignedIdentityProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword key_name: Name of the Key from KeyVault. - :paramtype key_name: str - :keyword key_vault_uri: Uri of KeyVault. - :paramtype key_vault_uri: str - :keyword key_version: Version of KeyVault. - :paramtype key_version: str - :keyword identity: - :paramtype identity: ~azure.mgmt.servicebus.v2021_11_01.models.UserAssignedIdentityProperties - """ - super().__init__(**kwargs) - self.key_name = key_name - self.key_vault_uri = key_vault_uri - self.key_version = key_version - self.identity = identity - - -class MessageCountDetails(_serialization.Model): - """Message Count Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar active_message_count: Number of active messages in the queue, topic, or subscription. - :vartype active_message_count: int - :ivar dead_letter_message_count: Number of messages that are dead lettered. - :vartype dead_letter_message_count: int - :ivar scheduled_message_count: Number of scheduled messages. - :vartype scheduled_message_count: int - :ivar transfer_message_count: Number of messages transferred to another queue, topic, or - subscription. - :vartype transfer_message_count: int - :ivar transfer_dead_letter_message_count: Number of messages transferred into dead letters. - :vartype transfer_dead_letter_message_count: int - """ - - _validation = { - "active_message_count": {"readonly": True}, - "dead_letter_message_count": {"readonly": True}, - "scheduled_message_count": {"readonly": True}, - "transfer_message_count": {"readonly": True}, - "transfer_dead_letter_message_count": {"readonly": True}, - } - - _attribute_map = { - "active_message_count": {"key": "activeMessageCount", "type": "int"}, - "dead_letter_message_count": {"key": "deadLetterMessageCount", "type": "int"}, - "scheduled_message_count": {"key": "scheduledMessageCount", "type": "int"}, - "transfer_message_count": {"key": "transferMessageCount", "type": "int"}, - "transfer_dead_letter_message_count": {"key": "transferDeadLetterMessageCount", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.active_message_count: Optional[int] = None - self.dead_letter_message_count: Optional[int] = None - self.scheduled_message_count: Optional[int] = None - self.transfer_message_count: Optional[int] = None - self.transfer_dead_letter_message_count: Optional[int] = None - - -class MigrationConfigListResult(_serialization.Model): - """The result of the List migrationConfigurations operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Migration Configs. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] - :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list - of migrationConfigurations. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[MigrationConfigProperties]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.MigrationConfigProperties"]] = None, **kwargs: Any) -> None: - """ - :keyword value: List of Migration Configs. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.MigrationConfigProperties] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class MigrationConfigProperties(ProxyResource): - """Single item in List or Get Migration Config operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar provisioning_state: Provisioning state of Migration Configuration. - :vartype provisioning_state: str - :ivar pending_replication_operations_count: Number of entities pending to be replicated. - :vartype pending_replication_operations_count: int - :ivar target_namespace: Existing premium Namespace ARM Id name which has no entities, will be - used for migration. - :vartype target_namespace: str - :ivar post_migration_name: Name to access Standard Namespace after migration. - :vartype post_migration_name: str - :ivar migration_state: State in which Standard to Premium Migration is, possible values : - Unknown, Reverting, Completing, Initiating, Syncing, Active. - :vartype migration_state: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "pending_replication_operations_count": {"readonly": True}, - "migration_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "pending_replication_operations_count": {"key": "properties.pendingReplicationOperationsCount", "type": "int"}, - "target_namespace": {"key": "properties.targetNamespace", "type": "str"}, - "post_migration_name": {"key": "properties.postMigrationName", "type": "str"}, - "migration_state": {"key": "properties.migrationState", "type": "str"}, - } - - def __init__( - self, *, target_namespace: Optional[str] = None, post_migration_name: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword target_namespace: Existing premium Namespace ARM Id name which has no entities, will - be used for migration. - :paramtype target_namespace: str - :keyword post_migration_name: Name to access Standard Namespace after migration. - :paramtype post_migration_name: str - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.provisioning_state: Optional[str] = None - self.pending_replication_operations_count: Optional[int] = None - self.target_namespace = target_namespace - self.post_migration_name = post_migration_name - self.migration_state: Optional[str] = None - - -class NetworkRuleSet(ProxyResource): - """Description of NetworkRuleSet resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar trusted_service_access_enabled: Value that indicates whether Trusted Service Access is - Enabled or not. - :vartype trusted_service_access_enabled: bool - :ivar default_action: Default Action for Network Rule Set. Known values are: "Allow" and - "Deny". - :vartype default_action: str or ~azure.mgmt.servicebus.v2021_11_01.models.DefaultAction - :ivar virtual_network_rules: List VirtualNetwork Rules. - :vartype virtual_network_rules: - list[~azure.mgmt.servicebus.v2021_11_01.models.NWRuleSetVirtualNetworkRules] - :ivar ip_rules: List of IpRules. - :vartype ip_rules: list[~azure.mgmt.servicebus.v2021_11_01.models.NWRuleSetIpRules] - :ivar public_network_access: This determines if traffic is allowed over public network. By - default it is enabled. Known values are: "Enabled" and "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.servicebus.v2021_11_01.models.PublicNetworkAccessFlag - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "trusted_service_access_enabled": {"key": "properties.trustedServiceAccessEnabled", "type": "bool"}, - "default_action": {"key": "properties.defaultAction", "type": "str"}, - "virtual_network_rules": {"key": "properties.virtualNetworkRules", "type": "[NWRuleSetVirtualNetworkRules]"}, - "ip_rules": {"key": "properties.ipRules", "type": "[NWRuleSetIpRules]"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - } - - def __init__( - self, - *, - trusted_service_access_enabled: Optional[bool] = None, - default_action: Optional[Union[str, "_models.DefaultAction"]] = None, - virtual_network_rules: Optional[List["_models.NWRuleSetVirtualNetworkRules"]] = None, - ip_rules: Optional[List["_models.NWRuleSetIpRules"]] = None, - public_network_access: Union[str, "_models.PublicNetworkAccessFlag"] = "Enabled", - **kwargs: Any - ) -> None: - """ - :keyword trusted_service_access_enabled: Value that indicates whether Trusted Service Access is - Enabled or not. - :paramtype trusted_service_access_enabled: bool - :keyword default_action: Default Action for Network Rule Set. Known values are: "Allow" and - "Deny". - :paramtype default_action: str or ~azure.mgmt.servicebus.v2021_11_01.models.DefaultAction - :keyword virtual_network_rules: List VirtualNetwork Rules. - :paramtype virtual_network_rules: - list[~azure.mgmt.servicebus.v2021_11_01.models.NWRuleSetVirtualNetworkRules] - :keyword ip_rules: List of IpRules. - :paramtype ip_rules: list[~azure.mgmt.servicebus.v2021_11_01.models.NWRuleSetIpRules] - :keyword public_network_access: This determines if traffic is allowed over public network. By - default it is enabled. Known values are: "Enabled" and "Disabled". - :paramtype public_network_access: str or - ~azure.mgmt.servicebus.v2021_11_01.models.PublicNetworkAccessFlag - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.trusted_service_access_enabled = trusted_service_access_enabled - self.default_action = default_action - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.public_network_access = public_network_access - - -class NetworkRuleSetListResult(_serialization.Model): - """The response of the List NetworkRuleSet operation. - - :ivar value: Result of the List NetworkRuleSet operation. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet] - :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list - of NetworkRuleSet. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkRuleSet]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.NetworkRuleSet"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: Result of the List NetworkRuleSet operation. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleSet] - :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete - list of NetworkRuleSet. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NWRuleSetIpRules(_serialization.Model): - """Description of NetWorkRuleSet - IpRules resource. - - :ivar ip_mask: IP Mask. - :vartype ip_mask: str - :ivar action: The IP Filter Action. "Allow" - :vartype action: str or ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleIPAction - """ - - _attribute_map = { - "ip_mask": {"key": "ipMask", "type": "str"}, - "action": {"key": "action", "type": "str"}, - } - - def __init__( - self, - *, - ip_mask: Optional[str] = None, - action: Union[str, "_models.NetworkRuleIPAction"] = "Allow", - **kwargs: Any - ) -> None: - """ - :keyword ip_mask: IP Mask. - :paramtype ip_mask: str - :keyword action: The IP Filter Action. "Allow" - :paramtype action: str or ~azure.mgmt.servicebus.v2021_11_01.models.NetworkRuleIPAction - """ - super().__init__(**kwargs) - self.ip_mask = ip_mask - self.action = action - - -class NWRuleSetVirtualNetworkRules(_serialization.Model): - """Description of VirtualNetworkRules - NetworkRules resource. - - :ivar subnet: Subnet properties. - :vartype subnet: ~azure.mgmt.servicebus.v2021_11_01.models.Subnet - :ivar ignore_missing_vnet_service_endpoint: Value that indicates whether to ignore missing VNet - Service Endpoint. - :vartype ignore_missing_vnet_service_endpoint: bool - """ - - _attribute_map = { - "subnet": {"key": "subnet", "type": "Subnet"}, - "ignore_missing_vnet_service_endpoint": {"key": "ignoreMissingVnetServiceEndpoint", "type": "bool"}, - } - - def __init__( - self, - *, - subnet: Optional["_models.Subnet"] = None, - ignore_missing_vnet_service_endpoint: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword subnet: Subnet properties. - :paramtype subnet: ~azure.mgmt.servicebus.v2021_11_01.models.Subnet - :keyword ignore_missing_vnet_service_endpoint: Value that indicates whether to ignore missing - VNet Service Endpoint. - :paramtype ignore_missing_vnet_service_endpoint: bool - """ - super().__init__(**kwargs) - self.subnet = subnet - self.ignore_missing_vnet_service_endpoint = ignore_missing_vnet_service_endpoint - - -class Operation(_serialization.Model): - """A Service Bus REST API operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar is_data_action: Indicates whether the operation is a data action. - :vartype is_data_action: bool - :ivar display: Display of the operation. - :vartype display: ~azure.mgmt.servicebus.v2021_11_01.models.OperationDisplay - :ivar origin: Origin of the operation. - :vartype origin: str - :ivar properties: Properties of the operation. - :vartype properties: JSON - """ - - _validation = { - "name": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "properties": {"key": "properties", "type": "object"}, - } - - def __init__( - self, - *, - is_data_action: Optional[bool] = None, - display: Optional["_models.OperationDisplay"] = None, - origin: Optional[str] = None, - properties: Optional[JSON] = None, - **kwargs: Any - ) -> None: - """ - :keyword is_data_action: Indicates whether the operation is a data action. - :paramtype is_data_action: bool - :keyword display: Display of the operation. - :paramtype display: ~azure.mgmt.servicebus.v2021_11_01.models.OperationDisplay - :keyword origin: Origin of the operation. - :paramtype origin: str - :keyword properties: Properties of the operation. - :paramtype properties: JSON - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.is_data_action = is_data_action - self.display = display - self.origin = origin - self.properties = properties - - -class OperationDisplay(_serialization.Model): - """Operation display payload. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: Resource provider of the operation. - :vartype provider: str - :ivar resource: Resource of the operation. - :vartype resource: str - :ivar operation: Localized friendly name for the operation. - :vartype operation: str - :ivar description: Localized friendly description for the operation. - :vartype description: str - """ - - _validation = { - "provider": {"readonly": True}, - "resource": {"readonly": True}, - "operation": {"readonly": True}, - "description": {"readonly": True}, - } - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provider: Optional[str] = None - self.resource: Optional[str] = None - self.operation: Optional[str] = None - self.description: Optional[str] = None - - -class OperationListResult(_serialization.Model): - """Result of the request to list ServiceBus operations. It contains a list of operations and a URL - link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of ServiceBus operations supported by the Microsoft.ServiceBus resource - provider. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.Operation] - :ivar next_link: URL to get the next set of operation list results if there are any. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[List["_models.Operation"]] = None - self.next_link: Optional[str] = None - - -class PrivateEndpoint(_serialization.Model): - """PrivateEndpoint information. - - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: The ARM identifier for Private Endpoint. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class PrivateEndpointConnection(ProxyResource): - """Properties of the PrivateEndpointConnection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar private_endpoint: The Private Endpoint resource for this Connection. - :vartype private_endpoint: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpoint - :ivar private_link_service_connection_state: Details about the state of the connection. - :vartype private_link_service_connection_state: - ~azure.mgmt.servicebus.v2021_11_01.models.ConnectionState - :ivar provisioning_state: Provisioning state of the Private Endpoint Connection. Known values - are: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.servicebus.v2021_11_01.models.EndPointProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, - "private_link_service_connection_state": { - "key": "properties.privateLinkServiceConnectionState", - "type": "ConnectionState", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - private_endpoint: Optional["_models.PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["_models.ConnectionState"] = None, - provisioning_state: Optional[Union[str, "_models.EndPointProvisioningState"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword private_endpoint: The Private Endpoint resource for this Connection. - :paramtype private_endpoint: ~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpoint - :keyword private_link_service_connection_state: Details about the state of the connection. - :paramtype private_link_service_connection_state: - ~azure.mgmt.servicebus.v2021_11_01.models.ConnectionState - :keyword provisioning_state: Provisioning state of the Private Endpoint Connection. Known - values are: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed". - :paramtype provisioning_state: str or - ~azure.mgmt.servicebus.v2021_11_01.models.EndPointProvisioningState - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = provisioning_state - - -class PrivateEndpointConnectionListResult(_serialization.Model): - """Result of the list of all private endpoint connections operation. - - :ivar value: A collection of private endpoint connection resources. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection] - :ivar next_link: A link for the next page of private endpoint connection resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.PrivateEndpointConnection"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: A collection of private endpoint connection resources. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection] - :keyword next_link: A link for the next page of private endpoint connection resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PrivateLinkResource(_serialization.Model): - """Information of the private link resource. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource. - :vartype name: str - :ivar type: Type of the resource. - :vartype type: str - :ivar group_id: - :vartype group_id: str - :ivar required_members: Required Members. - :vartype required_members: list[str] - :ivar required_zone_names: Required Zone Names. - :vartype required_zone_names: list[str] - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "group_id": {"key": "properties.groupId", "type": "str"}, - "required_members": {"key": "properties.requiredMembers", "type": "[str]"}, - "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - name: Optional[str] = None, - type: Optional[str] = None, - group_id: Optional[str] = None, - required_members: Optional[List[str]] = None, - required_zone_names: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Fully qualified identifier of the resource. - :paramtype id: str - :keyword name: Name of the resource. - :paramtype name: str - :keyword type: Type of the resource. - :paramtype type: str - :keyword group_id: - :paramtype group_id: str - :keyword required_members: Required Members. - :paramtype required_members: list[str] - :keyword required_zone_names: Required Zone Names. - :paramtype required_zone_names: list[str] - """ - super().__init__(**kwargs) - self.id = id - self.name = name - self.type = type - self.group_id = group_id - self.required_members = required_members - self.required_zone_names = required_zone_names - - -class PrivateLinkResourcesListResult(_serialization.Model): - """Result of the List private link resources operation. - - :ivar value: A collection of private link resources. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.PrivateLinkResource] - :ivar next_link: A link for the next page of private link resources. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[PrivateLinkResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.PrivateLinkResource"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: A collection of private link resources. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.PrivateLinkResource] - :keyword next_link: A link for the next page of private link resources. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class RegenerateAccessKeyParameters(_serialization.Model): - """Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs - to be reset. - - All required parameters must be populated in order to send to server. - - :ivar key_type: The access key to regenerate. Required. Known values are: "PrimaryKey" and - "SecondaryKey". - :vartype key_type: str or ~azure.mgmt.servicebus.v2021_11_01.models.KeyType - :ivar key: Optional, if the key value provided, is reset for KeyType value or autogenerate Key - value set for keyType. - :vartype key: str - """ - - _validation = { - "key_type": {"required": True}, - } - - _attribute_map = { - "key_type": {"key": "keyType", "type": "str"}, - "key": {"key": "key", "type": "str"}, - } - - def __init__(self, *, key_type: Union[str, "_models.KeyType"], key: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword key_type: The access key to regenerate. Required. Known values are: "PrimaryKey" and - "SecondaryKey". - :paramtype key_type: str or ~azure.mgmt.servicebus.v2021_11_01.models.KeyType - :keyword key: Optional, if the key value provided, is reset for KeyType value or autogenerate - Key value set for keyType. - :paramtype key: str - """ - super().__init__(**kwargs) - self.key_type = key_type - self.key = key - - -class Resource(_serialization.Model): - """The Resource definition for other than namespace. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :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: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - - -class ResourceNamespacePatch(Resource): - """The Resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, 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"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword location: Resource location. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - - -class Rule(ProxyResource): - """Description of Rule Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar action: Represents the filter actions which are allowed for the transformation of a - message that have been matched by a filter expression. - :vartype action: ~azure.mgmt.servicebus.v2021_11_01.models.Action - :ivar filter_type: Filter type that is evaluated against a BrokeredMessage. Known values are: - "SqlFilter" and "CorrelationFilter". - :vartype filter_type: str or ~azure.mgmt.servicebus.v2021_11_01.models.FilterType - :ivar sql_filter: Properties of sqlFilter. - :vartype sql_filter: ~azure.mgmt.servicebus.v2021_11_01.models.SqlFilter - :ivar correlation_filter: Properties of correlationFilter. - :vartype correlation_filter: ~azure.mgmt.servicebus.v2021_11_01.models.CorrelationFilter - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "action": {"key": "properties.action", "type": "Action"}, - "filter_type": {"key": "properties.filterType", "type": "str"}, - "sql_filter": {"key": "properties.sqlFilter", "type": "SqlFilter"}, - "correlation_filter": {"key": "properties.correlationFilter", "type": "CorrelationFilter"}, - } - - def __init__( - self, - *, - action: Optional["_models.Action"] = None, - filter_type: Optional[Union[str, "_models.FilterType"]] = None, - sql_filter: Optional["_models.SqlFilter"] = None, - correlation_filter: Optional["_models.CorrelationFilter"] = None, - **kwargs: Any - ) -> None: - """ - :keyword action: Represents the filter actions which are allowed for the transformation of a - message that have been matched by a filter expression. - :paramtype action: ~azure.mgmt.servicebus.v2021_11_01.models.Action - :keyword filter_type: Filter type that is evaluated against a BrokeredMessage. Known values - are: "SqlFilter" and "CorrelationFilter". - :paramtype filter_type: str or ~azure.mgmt.servicebus.v2021_11_01.models.FilterType - :keyword sql_filter: Properties of sqlFilter. - :paramtype sql_filter: ~azure.mgmt.servicebus.v2021_11_01.models.SqlFilter - :keyword correlation_filter: Properties of correlationFilter. - :paramtype correlation_filter: ~azure.mgmt.servicebus.v2021_11_01.models.CorrelationFilter - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.action = action - self.filter_type = filter_type - self.sql_filter = sql_filter - self.correlation_filter = correlation_filter - - -class RuleListResult(_serialization.Model): - """The response of the List rule operation. - - :ivar value: Result of the List Rules operation. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.Rule] - :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list - of rules. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[Rule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.Rule"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: Result of the List Rules operation. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.Rule] - :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete - list of rules. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SBAuthorizationRule(ProxyResource): - """Description of a namespace authorization rule. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar rights: The rights associated with the rule. - :vartype rights: list[str or ~azure.mgmt.servicebus.v2021_11_01.models.AccessRights] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "rights": {"key": "properties.rights", "type": "[str]"}, - } - - def __init__(self, *, rights: Optional[List[Union[str, "_models.AccessRights"]]] = None, **kwargs: Any) -> None: - """ - :keyword rights: The rights associated with the rule. - :paramtype rights: list[str or ~azure.mgmt.servicebus.v2021_11_01.models.AccessRights] - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.rights = rights - - -class SBAuthorizationRuleListResult(_serialization.Model): - """The response to the List Namespace operation. - - :ivar value: Result of the List Authorization Rules operation. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] - :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list - of Authorization Rules. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[SBAuthorizationRule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[List["_models.SBAuthorizationRule"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: Result of the List Authorization Rules operation. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBAuthorizationRule] - :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete - list of Authorization Rules. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SBClientAffineProperties(_serialization.Model): - """Properties specific to client affine subscriptions. - - :ivar client_id: Indicates the Client ID of the application that created the client-affine - subscription. - :vartype client_id: str - :ivar is_durable: For client-affine subscriptions, this value indicates whether the - subscription is durable or not. - :vartype is_durable: bool - :ivar is_shared: For client-affine subscriptions, this value indicates whether the subscription - is shared or not. - :vartype is_shared: bool - """ - - _attribute_map = { - "client_id": {"key": "clientId", "type": "str"}, - "is_durable": {"key": "isDurable", "type": "bool"}, - "is_shared": {"key": "isShared", "type": "bool"}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - is_durable: Optional[bool] = None, - is_shared: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword client_id: Indicates the Client ID of the application that created the client-affine - subscription. - :paramtype client_id: str - :keyword is_durable: For client-affine subscriptions, this value indicates whether the - subscription is durable or not. - :paramtype is_durable: bool - :keyword is_shared: For client-affine subscriptions, this value indicates whether the - subscription is shared or not. - :paramtype is_shared: bool - """ - super().__init__(**kwargs) - self.client_id = client_id - self.is_durable = is_durable - self.is_shared = is_shared - - -class TrackedResource(Resource): - """The Resource definition. - - 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: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: The Geo-location where the resource lives. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword location: The Geo-location where the resource lives. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - - -class SBNamespace(TrackedResource): - """Description of a namespace resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: The Geo-location where the resource lives. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Properties of SKU. - :vartype sku: ~azure.mgmt.servicebus.v2021_11_01.models.SBSku - :ivar identity: Properties of BYOK Identity description. - :vartype identity: ~azure.mgmt.servicebus.v2021_11_01.models.Identity - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar provisioning_state: Provisioning state of the namespace. - :vartype provisioning_state: str - :ivar status: Status of the namespace. - :vartype status: str - :ivar created_at: The time the namespace was created. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: ~datetime.datetime - :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus operations. - :vartype service_bus_endpoint: str - :ivar metric_id: Identifier for Azure Insights metrics. - :vartype metric_id: str - :ivar zone_redundant: Enabling this property creates a Premium Service Bus Namespace in regions - supported availability zones. - :vartype zone_redundant: bool - :ivar encryption: Properties of BYOK Encryption description. - :vartype encryption: ~azure.mgmt.servicebus.v2021_11_01.models.Encryption - :ivar private_endpoint_connections: List of private endpoint connections. - :vartype private_endpoint_connections: - list[~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection] - :ivar disable_local_auth: This property disables SAS authentication for the Service Bus - namespace. - :vartype disable_local_auth: bool - :ivar alternate_name: Alternate name for namespace. - :vartype alternate_name: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "status": {"readonly": True}, - "created_at": {"readonly": True}, - "updated_at": {"readonly": True}, - "service_bus_endpoint": {"readonly": True}, - "metric_id": {"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": "SBSku"}, - "identity": {"key": "identity", "type": "Identity"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "created_at": {"key": "properties.createdAt", "type": "iso-8601"}, - "updated_at": {"key": "properties.updatedAt", "type": "iso-8601"}, - "service_bus_endpoint": {"key": "properties.serviceBusEndpoint", "type": "str"}, - "metric_id": {"key": "properties.metricId", "type": "str"}, - "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[PrivateEndpointConnection]", - }, - "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, - "alternate_name": {"key": "properties.alternateName", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.SBSku"] = None, - identity: Optional["_models.Identity"] = None, - zone_redundant: Optional[bool] = None, - encryption: Optional["_models.Encryption"] = None, - private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = None, - disable_local_auth: Optional[bool] = None, - alternate_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The Geo-location where the resource lives. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Properties of SKU. - :paramtype sku: ~azure.mgmt.servicebus.v2021_11_01.models.SBSku - :keyword identity: Properties of BYOK Identity description. - :paramtype identity: ~azure.mgmt.servicebus.v2021_11_01.models.Identity - :keyword zone_redundant: Enabling this property creates a Premium Service Bus Namespace in - regions supported availability zones. - :paramtype zone_redundant: bool - :keyword encryption: Properties of BYOK Encryption description. - :paramtype encryption: ~azure.mgmt.servicebus.v2021_11_01.models.Encryption - :keyword private_endpoint_connections: List of private endpoint connections. - :paramtype private_endpoint_connections: - list[~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection] - :keyword disable_local_auth: This property disables SAS authentication for the Service Bus - namespace. - :paramtype disable_local_auth: bool - :keyword alternate_name: Alternate name for namespace. - :paramtype alternate_name: str - """ - super().__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.identity = identity - self.system_data: Optional["_models.SystemData"] = None - self.provisioning_state: Optional[str] = None - self.status: Optional[str] = None - self.created_at: Optional[datetime.datetime] = None - self.updated_at: Optional[datetime.datetime] = None - self.service_bus_endpoint: Optional[str] = None - self.metric_id: Optional[str] = None - self.zone_redundant = zone_redundant - self.encryption = encryption - self.private_endpoint_connections = private_endpoint_connections - self.disable_local_auth = disable_local_auth - self.alternate_name = alternate_name - - -class SBNamespaceListResult(_serialization.Model): - """The response of the List Namespace operation. - - :ivar value: Result of the List Namespace operation. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] - :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list - of Namespaces. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[SBNamespace]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.SBNamespace"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: Result of the List Namespace operation. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBNamespace] - :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete - list of Namespaces. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SBNamespaceUpdateParameters(ResourceNamespacePatch): - """Description of a namespace resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: Properties of SKU. - :vartype sku: ~azure.mgmt.servicebus.v2021_11_01.models.SBSku - :ivar identity: Properties of BYOK Identity description. - :vartype identity: ~azure.mgmt.servicebus.v2021_11_01.models.Identity - :ivar provisioning_state: Provisioning state of the namespace. - :vartype provisioning_state: str - :ivar status: Status of the namespace. - :vartype status: str - :ivar created_at: The time the namespace was created. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The time the namespace was updated. - :vartype updated_at: ~datetime.datetime - :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus operations. - :vartype service_bus_endpoint: str - :ivar metric_id: Identifier for Azure Insights metrics. - :vartype metric_id: str - :ivar encryption: Properties of BYOK Encryption description. - :vartype encryption: ~azure.mgmt.servicebus.v2021_11_01.models.Encryption - :ivar private_endpoint_connections: List of private endpoint connections. - :vartype private_endpoint_connections: - list[~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection] - :ivar disable_local_auth: This property disables SAS authentication for the Service Bus - namespace. - :vartype disable_local_auth: bool - :ivar alternate_name: Alternate name for namespace. - :vartype alternate_name: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "status": {"readonly": True}, - "created_at": {"readonly": True}, - "updated_at": {"readonly": True}, - "service_bus_endpoint": {"readonly": True}, - "metric_id": {"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": "SBSku"}, - "identity": {"key": "identity", "type": "Identity"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "created_at": {"key": "properties.createdAt", "type": "iso-8601"}, - "updated_at": {"key": "properties.updatedAt", "type": "iso-8601"}, - "service_bus_endpoint": {"key": "properties.serviceBusEndpoint", "type": "str"}, - "metric_id": {"key": "properties.metricId", "type": "str"}, - "encryption": {"key": "properties.encryption", "type": "Encryption"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[PrivateEndpointConnection]", - }, - "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, - "alternate_name": {"key": "properties.alternateName", "type": "str"}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["_models.SBSku"] = None, - identity: Optional["_models.Identity"] = None, - encryption: Optional["_models.Encryption"] = None, - private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = None, - disable_local_auth: Optional[bool] = None, - alternate_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: Properties of SKU. - :paramtype sku: ~azure.mgmt.servicebus.v2021_11_01.models.SBSku - :keyword identity: Properties of BYOK Identity description. - :paramtype identity: ~azure.mgmt.servicebus.v2021_11_01.models.Identity - :keyword encryption: Properties of BYOK Encryption description. - :paramtype encryption: ~azure.mgmt.servicebus.v2021_11_01.models.Encryption - :keyword private_endpoint_connections: List of private endpoint connections. - :paramtype private_endpoint_connections: - list[~azure.mgmt.servicebus.v2021_11_01.models.PrivateEndpointConnection] - :keyword disable_local_auth: This property disables SAS authentication for the Service Bus - namespace. - :paramtype disable_local_auth: bool - :keyword alternate_name: Alternate name for namespace. - :paramtype alternate_name: str - """ - super().__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.identity = identity - self.provisioning_state: Optional[str] = None - self.status: Optional[str] = None - self.created_at: Optional[datetime.datetime] = None - self.updated_at: Optional[datetime.datetime] = None - self.service_bus_endpoint: Optional[str] = None - self.metric_id: Optional[str] = None - self.encryption = encryption - self.private_endpoint_connections = private_endpoint_connections - self.disable_local_auth = disable_local_auth - self.alternate_name = alternate_name - - -class SBQueue(ProxyResource): - """Description of queue Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar count_details: Message Count Details. - :vartype count_details: ~azure.mgmt.servicebus.v2021_11_01.models.MessageCountDetails - :ivar created_at: The exact time the message was created. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The exact time the message was updated. - :vartype updated_at: ~datetime.datetime - :ivar accessed_at: Last time a message was sent, or the last time there was a receive request - to this queue. - :vartype accessed_at: ~datetime.datetime - :ivar size_in_bytes: The size of the queue, in bytes. - :vartype size_in_bytes: int - :ivar message_count: The number of messages in the queue. - :vartype message_count: int - :ivar lock_duration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time - that the message is locked for other receivers. The maximum value for LockDuration is 5 - minutes; the default value is 1 minute. - :vartype lock_duration: ~datetime.timedelta - :ivar max_size_in_megabytes: The maximum size of the queue in megabytes, which is the size of - memory allocated for the queue. Default is 1024. - :vartype max_size_in_megabytes: int - :ivar max_message_size_in_kilobytes: Maximum size (in KB) of the message payload that can be - accepted by the queue. This property is only used in Premium today and default is 1024. - :vartype max_message_size_in_kilobytes: int - :ivar requires_duplicate_detection: A value indicating if this queue requires duplicate - detection. - :vartype requires_duplicate_detection: bool - :ivar requires_session: A value that indicates whether the queue supports the concept of - sessions. - :vartype requires_session: bool - :ivar default_message_time_to_live: ISO 8601 default message timespan to live value. This is - the duration after which the message expires, starting from when the message is sent to Service - Bus. This is the default value used when TimeToLive is not set on a message itself. - :vartype default_message_time_to_live: ~datetime.timedelta - :ivar dead_lettering_on_message_expiration: A value that indicates whether this queue has dead - letter support when a message expires. - :vartype dead_lettering_on_message_expiration: bool - :ivar duplicate_detection_history_time_window: ISO 8601 timeSpan structure that defines the - duration of the duplicate detection history. The default value is 10 minutes. - :vartype duplicate_detection_history_time_window: ~datetime.timedelta - :ivar max_delivery_count: The maximum delivery count. A message is automatically deadlettered - after this number of deliveries. default value is 10. - :vartype max_delivery_count: int - :ivar status: Enumerates the possible values for the status of a messaging entity. Known values - are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", - "Deleting", "Renaming", and "Unknown". - :vartype status: str or ~azure.mgmt.servicebus.v2021_11_01.models.EntityStatus - :ivar enable_batched_operations: Value that indicates whether server-side batched operations - are enabled. - :vartype enable_batched_operations: bool - :ivar auto_delete_on_idle: ISO 8061 timeSpan idle interval after which the queue is - automatically deleted. The minimum duration is 5 minutes. - :vartype auto_delete_on_idle: ~datetime.timedelta - :ivar enable_partitioning: A value that indicates whether the queue is to be partitioned across - multiple message brokers. - :vartype enable_partitioning: bool - :ivar enable_express: A value that indicates whether Express Entities are enabled. An express - queue holds a message in memory temporarily before writing it to persistent storage. - :vartype enable_express: bool - :ivar forward_to: Queue/Topic name to forward the messages. - :vartype forward_to: str - :ivar forward_dead_lettered_messages_to: Queue/Topic name to forward the Dead Letter message. - :vartype forward_dead_lettered_messages_to: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "system_data": {"readonly": True}, - "count_details": {"readonly": True}, - "created_at": {"readonly": True}, - "updated_at": {"readonly": True}, - "accessed_at": {"readonly": True}, - "size_in_bytes": {"readonly": True}, - "message_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"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "count_details": {"key": "properties.countDetails", "type": "MessageCountDetails"}, - "created_at": {"key": "properties.createdAt", "type": "iso-8601"}, - "updated_at": {"key": "properties.updatedAt", "type": "iso-8601"}, - "accessed_at": {"key": "properties.accessedAt", "type": "iso-8601"}, - "size_in_bytes": {"key": "properties.sizeInBytes", "type": "int"}, - "message_count": {"key": "properties.messageCount", "type": "int"}, - "lock_duration": {"key": "properties.lockDuration", "type": "duration"}, - "max_size_in_megabytes": {"key": "properties.maxSizeInMegabytes", "type": "int"}, - "max_message_size_in_kilobytes": {"key": "properties.maxMessageSizeInKilobytes", "type": "int"}, - "requires_duplicate_detection": {"key": "properties.requiresDuplicateDetection", "type": "bool"}, - "requires_session": {"key": "properties.requiresSession", "type": "bool"}, - "default_message_time_to_live": {"key": "properties.defaultMessageTimeToLive", "type": "duration"}, - "dead_lettering_on_message_expiration": {"key": "properties.deadLetteringOnMessageExpiration", "type": "bool"}, - "duplicate_detection_history_time_window": { - "key": "properties.duplicateDetectionHistoryTimeWindow", - "type": "duration", - }, - "max_delivery_count": {"key": "properties.maxDeliveryCount", "type": "int"}, - "status": {"key": "properties.status", "type": "str"}, - "enable_batched_operations": {"key": "properties.enableBatchedOperations", "type": "bool"}, - "auto_delete_on_idle": {"key": "properties.autoDeleteOnIdle", "type": "duration"}, - "enable_partitioning": {"key": "properties.enablePartitioning", "type": "bool"}, - "enable_express": {"key": "properties.enableExpress", "type": "bool"}, - "forward_to": {"key": "properties.forwardTo", "type": "str"}, - "forward_dead_lettered_messages_to": {"key": "properties.forwardDeadLetteredMessagesTo", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - lock_duration: Optional[datetime.timedelta] = None, - max_size_in_megabytes: Optional[int] = None, - max_message_size_in_kilobytes: Optional[int] = None, - requires_duplicate_detection: Optional[bool] = None, - requires_session: Optional[bool] = None, - default_message_time_to_live: Optional[datetime.timedelta] = None, - dead_lettering_on_message_expiration: Optional[bool] = None, - duplicate_detection_history_time_window: Optional[datetime.timedelta] = None, - max_delivery_count: Optional[int] = None, - status: Optional[Union[str, "_models.EntityStatus"]] = None, - enable_batched_operations: Optional[bool] = None, - auto_delete_on_idle: Optional[datetime.timedelta] = None, - enable_partitioning: Optional[bool] = None, - enable_express: Optional[bool] = None, - forward_to: Optional[str] = None, - forward_dead_lettered_messages_to: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword lock_duration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time - that the message is locked for other receivers. The maximum value for LockDuration is 5 - minutes; the default value is 1 minute. - :paramtype lock_duration: ~datetime.timedelta - :keyword max_size_in_megabytes: The maximum size of the queue in megabytes, which is the size - of memory allocated for the queue. Default is 1024. - :paramtype max_size_in_megabytes: int - :keyword max_message_size_in_kilobytes: Maximum size (in KB) of the message payload that can be - accepted by the queue. This property is only used in Premium today and default is 1024. - :paramtype max_message_size_in_kilobytes: int - :keyword requires_duplicate_detection: A value indicating if this queue requires duplicate - detection. - :paramtype requires_duplicate_detection: bool - :keyword requires_session: A value that indicates whether the queue supports the concept of - sessions. - :paramtype requires_session: bool - :keyword default_message_time_to_live: ISO 8601 default message timespan to live value. This is - the duration after which the message expires, starting from when the message is sent to Service - Bus. This is the default value used when TimeToLive is not set on a message itself. - :paramtype default_message_time_to_live: ~datetime.timedelta - :keyword dead_lettering_on_message_expiration: A value that indicates whether this queue has - dead letter support when a message expires. - :paramtype dead_lettering_on_message_expiration: bool - :keyword duplicate_detection_history_time_window: ISO 8601 timeSpan structure that defines the - duration of the duplicate detection history. The default value is 10 minutes. - :paramtype duplicate_detection_history_time_window: ~datetime.timedelta - :keyword max_delivery_count: The maximum delivery count. A message is automatically - deadlettered after this number of deliveries. default value is 10. - :paramtype max_delivery_count: int - :keyword status: Enumerates the possible values for the status of a messaging entity. Known - values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", - "Deleting", "Renaming", and "Unknown". - :paramtype status: str or ~azure.mgmt.servicebus.v2021_11_01.models.EntityStatus - :keyword enable_batched_operations: Value that indicates whether server-side batched operations - are enabled. - :paramtype enable_batched_operations: bool - :keyword auto_delete_on_idle: ISO 8061 timeSpan idle interval after which the queue is - automatically deleted. The minimum duration is 5 minutes. - :paramtype auto_delete_on_idle: ~datetime.timedelta - :keyword enable_partitioning: A value that indicates whether the queue is to be partitioned - across multiple message brokers. - :paramtype enable_partitioning: bool - :keyword enable_express: A value that indicates whether Express Entities are enabled. An - express queue holds a message in memory temporarily before writing it to persistent storage. - :paramtype enable_express: bool - :keyword forward_to: Queue/Topic name to forward the messages. - :paramtype forward_to: str - :keyword forward_dead_lettered_messages_to: Queue/Topic name to forward the Dead Letter - message. - :paramtype forward_dead_lettered_messages_to: str - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.count_details: Optional["_models.MessageCountDetails"] = None - self.created_at: Optional[datetime.datetime] = None - self.updated_at: Optional[datetime.datetime] = None - self.accessed_at: Optional[datetime.datetime] = None - self.size_in_bytes: Optional[int] = None - self.message_count: Optional[int] = None - self.lock_duration = lock_duration - self.max_size_in_megabytes = max_size_in_megabytes - self.max_message_size_in_kilobytes = max_message_size_in_kilobytes - self.requires_duplicate_detection = requires_duplicate_detection - self.requires_session = requires_session - self.default_message_time_to_live = default_message_time_to_live - self.dead_lettering_on_message_expiration = dead_lettering_on_message_expiration - self.duplicate_detection_history_time_window = duplicate_detection_history_time_window - self.max_delivery_count = max_delivery_count - self.status = status - self.enable_batched_operations = enable_batched_operations - self.auto_delete_on_idle = auto_delete_on_idle - self.enable_partitioning = enable_partitioning - self.enable_express = enable_express - self.forward_to = forward_to - self.forward_dead_lettered_messages_to = forward_dead_lettered_messages_to - - -class SBQueueListResult(_serialization.Model): - """The response to the List Queues operation. - - :ivar value: Result of the List Queues operation. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBQueue] - :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list - of queues. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[SBQueue]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.SBQueue"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: Result of the List Queues operation. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBQueue] - :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete - list of queues. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SBSku(_serialization.Model): - """SKU of the namespace. - - All required parameters must be populated in order to send to server. - - :ivar name: Name of this SKU. Required. Known values are: "Basic", "Standard", and "Premium". - :vartype name: str or ~azure.mgmt.servicebus.v2021_11_01.models.SkuName - :ivar tier: The billing tier of this particular SKU. Known values are: "Basic", "Standard", and - "Premium". - :vartype tier: str or ~azure.mgmt.servicebus.v2021_11_01.models.SkuTier - :ivar capacity: The specified messaging units for the tier. For Premium tier, capacity are 1,2 - and 4. - :vartype capacity: int - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - "capacity": {"key": "capacity", "type": "int"}, - } - - def __init__( - self, - *, - name: Union[str, "_models.SkuName"], - tier: Optional[Union[str, "_models.SkuTier"]] = None, - capacity: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of this SKU. Required. Known values are: "Basic", "Standard", and - "Premium". - :paramtype name: str or ~azure.mgmt.servicebus.v2021_11_01.models.SkuName - :keyword tier: The billing tier of this particular SKU. Known values are: "Basic", "Standard", - and "Premium". - :paramtype tier: str or ~azure.mgmt.servicebus.v2021_11_01.models.SkuTier - :keyword capacity: The specified messaging units for the tier. For Premium tier, capacity are - 1,2 and 4. - :paramtype capacity: int - """ - super().__init__(**kwargs) - self.name = name - self.tier = tier - self.capacity = capacity - - -class SBSubscription(ProxyResource): - """Description of subscription resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar message_count: Number of messages. - :vartype message_count: int - :ivar created_at: Exact time the message was created. - :vartype created_at: ~datetime.datetime - :ivar accessed_at: Last time there was a receive request to this subscription. - :vartype accessed_at: ~datetime.datetime - :ivar updated_at: The exact time the message was updated. - :vartype updated_at: ~datetime.datetime - :ivar count_details: Message count details. - :vartype count_details: ~azure.mgmt.servicebus.v2021_11_01.models.MessageCountDetails - :ivar lock_duration: ISO 8061 lock duration timespan for the subscription. The default value is - 1 minute. - :vartype lock_duration: ~datetime.timedelta - :ivar requires_session: Value indicating if a subscription supports the concept of sessions. - :vartype requires_session: bool - :ivar default_message_time_to_live: ISO 8061 Default message timespan to live value. This is - the duration after which the message expires, starting from when the message is sent to Service - Bus. This is the default value used when TimeToLive is not set on a message itself. - :vartype default_message_time_to_live: ~datetime.timedelta - :ivar dead_lettering_on_filter_evaluation_exceptions: Value that indicates whether a - subscription has dead letter support on filter evaluation exceptions. - :vartype dead_lettering_on_filter_evaluation_exceptions: bool - :ivar dead_lettering_on_message_expiration: Value that indicates whether a subscription has - dead letter support when a message expires. - :vartype dead_lettering_on_message_expiration: bool - :ivar duplicate_detection_history_time_window: ISO 8601 timeSpan structure that defines the - duration of the duplicate detection history. The default value is 10 minutes. - :vartype duplicate_detection_history_time_window: ~datetime.timedelta - :ivar max_delivery_count: Number of maximum deliveries. - :vartype max_delivery_count: int - :ivar status: Enumerates the possible values for the status of a messaging entity. Known values - are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", - "Deleting", "Renaming", and "Unknown". - :vartype status: str or ~azure.mgmt.servicebus.v2021_11_01.models.EntityStatus - :ivar enable_batched_operations: Value that indicates whether server-side batched operations - are enabled. - :vartype enable_batched_operations: bool - :ivar auto_delete_on_idle: ISO 8061 timeSpan idle interval after which the topic is - automatically deleted. The minimum duration is 5 minutes. - :vartype auto_delete_on_idle: ~datetime.timedelta - :ivar forward_to: Queue/Topic name to forward the messages. - :vartype forward_to: str - :ivar forward_dead_lettered_messages_to: Queue/Topic name to forward the Dead Letter message. - :vartype forward_dead_lettered_messages_to: str - :ivar is_client_affine: Value that indicates whether the subscription has an affinity to the - client id. - :vartype is_client_affine: bool - :ivar client_affine_properties: Properties specific to client affine subscriptions. - :vartype client_affine_properties: - ~azure.mgmt.servicebus.v2021_11_01.models.SBClientAffineProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "system_data": {"readonly": True}, - "message_count": {"readonly": True}, - "created_at": {"readonly": True}, - "accessed_at": {"readonly": True}, - "updated_at": {"readonly": True}, - "count_details": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "message_count": {"key": "properties.messageCount", "type": "int"}, - "created_at": {"key": "properties.createdAt", "type": "iso-8601"}, - "accessed_at": {"key": "properties.accessedAt", "type": "iso-8601"}, - "updated_at": {"key": "properties.updatedAt", "type": "iso-8601"}, - "count_details": {"key": "properties.countDetails", "type": "MessageCountDetails"}, - "lock_duration": {"key": "properties.lockDuration", "type": "duration"}, - "requires_session": {"key": "properties.requiresSession", "type": "bool"}, - "default_message_time_to_live": {"key": "properties.defaultMessageTimeToLive", "type": "duration"}, - "dead_lettering_on_filter_evaluation_exceptions": { - "key": "properties.deadLetteringOnFilterEvaluationExceptions", - "type": "bool", - }, - "dead_lettering_on_message_expiration": {"key": "properties.deadLetteringOnMessageExpiration", "type": "bool"}, - "duplicate_detection_history_time_window": { - "key": "properties.duplicateDetectionHistoryTimeWindow", - "type": "duration", - }, - "max_delivery_count": {"key": "properties.maxDeliveryCount", "type": "int"}, - "status": {"key": "properties.status", "type": "str"}, - "enable_batched_operations": {"key": "properties.enableBatchedOperations", "type": "bool"}, - "auto_delete_on_idle": {"key": "properties.autoDeleteOnIdle", "type": "duration"}, - "forward_to": {"key": "properties.forwardTo", "type": "str"}, - "forward_dead_lettered_messages_to": {"key": "properties.forwardDeadLetteredMessagesTo", "type": "str"}, - "is_client_affine": {"key": "properties.isClientAffine", "type": "bool"}, - "client_affine_properties": {"key": "properties.clientAffineProperties", "type": "SBClientAffineProperties"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - lock_duration: Optional[datetime.timedelta] = None, - requires_session: Optional[bool] = None, - default_message_time_to_live: Optional[datetime.timedelta] = None, - dead_lettering_on_filter_evaluation_exceptions: Optional[bool] = None, - dead_lettering_on_message_expiration: Optional[bool] = None, - duplicate_detection_history_time_window: Optional[datetime.timedelta] = None, - max_delivery_count: Optional[int] = None, - status: Optional[Union[str, "_models.EntityStatus"]] = None, - enable_batched_operations: Optional[bool] = None, - auto_delete_on_idle: Optional[datetime.timedelta] = None, - forward_to: Optional[str] = None, - forward_dead_lettered_messages_to: Optional[str] = None, - is_client_affine: Optional[bool] = None, - client_affine_properties: Optional["_models.SBClientAffineProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword lock_duration: ISO 8061 lock duration timespan for the subscription. The default value - is 1 minute. - :paramtype lock_duration: ~datetime.timedelta - :keyword requires_session: Value indicating if a subscription supports the concept of sessions. - :paramtype requires_session: bool - :keyword default_message_time_to_live: ISO 8061 Default message timespan to live value. This is - the duration after which the message expires, starting from when the message is sent to Service - Bus. This is the default value used when TimeToLive is not set on a message itself. - :paramtype default_message_time_to_live: ~datetime.timedelta - :keyword dead_lettering_on_filter_evaluation_exceptions: Value that indicates whether a - subscription has dead letter support on filter evaluation exceptions. - :paramtype dead_lettering_on_filter_evaluation_exceptions: bool - :keyword dead_lettering_on_message_expiration: Value that indicates whether a subscription has - dead letter support when a message expires. - :paramtype dead_lettering_on_message_expiration: bool - :keyword duplicate_detection_history_time_window: ISO 8601 timeSpan structure that defines the - duration of the duplicate detection history. The default value is 10 minutes. - :paramtype duplicate_detection_history_time_window: ~datetime.timedelta - :keyword max_delivery_count: Number of maximum deliveries. - :paramtype max_delivery_count: int - :keyword status: Enumerates the possible values for the status of a messaging entity. Known - values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", - "Deleting", "Renaming", and "Unknown". - :paramtype status: str or ~azure.mgmt.servicebus.v2021_11_01.models.EntityStatus - :keyword enable_batched_operations: Value that indicates whether server-side batched operations - are enabled. - :paramtype enable_batched_operations: bool - :keyword auto_delete_on_idle: ISO 8061 timeSpan idle interval after which the topic is - automatically deleted. The minimum duration is 5 minutes. - :paramtype auto_delete_on_idle: ~datetime.timedelta - :keyword forward_to: Queue/Topic name to forward the messages. - :paramtype forward_to: str - :keyword forward_dead_lettered_messages_to: Queue/Topic name to forward the Dead Letter - message. - :paramtype forward_dead_lettered_messages_to: str - :keyword is_client_affine: Value that indicates whether the subscription has an affinity to the - client id. - :paramtype is_client_affine: bool - :keyword client_affine_properties: Properties specific to client affine subscriptions. - :paramtype client_affine_properties: - ~azure.mgmt.servicebus.v2021_11_01.models.SBClientAffineProperties - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.message_count: Optional[int] = None - self.created_at: Optional[datetime.datetime] = None - self.accessed_at: Optional[datetime.datetime] = None - self.updated_at: Optional[datetime.datetime] = None - self.count_details: Optional["_models.MessageCountDetails"] = None - self.lock_duration = lock_duration - self.requires_session = requires_session - self.default_message_time_to_live = default_message_time_to_live - self.dead_lettering_on_filter_evaluation_exceptions = dead_lettering_on_filter_evaluation_exceptions - self.dead_lettering_on_message_expiration = dead_lettering_on_message_expiration - self.duplicate_detection_history_time_window = duplicate_detection_history_time_window - self.max_delivery_count = max_delivery_count - self.status = status - self.enable_batched_operations = enable_batched_operations - self.auto_delete_on_idle = auto_delete_on_idle - self.forward_to = forward_to - self.forward_dead_lettered_messages_to = forward_dead_lettered_messages_to - self.is_client_affine = is_client_affine - self.client_affine_properties = client_affine_properties - - -class SBSubscriptionListResult(_serialization.Model): - """The response to the List Subscriptions operation. - - :ivar value: Result of the List Subscriptions operation. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription] - :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list - of subscriptions. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[SBSubscription]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.SBSubscription"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: Result of the List Subscriptions operation. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBSubscription] - :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete - list of subscriptions. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SBTopic(ProxyResource): - """Description of topic resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or - "Microsoft.EventHub/Namespaces/EventHubs". - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.servicebus.v2021_11_01.models.SystemData - :ivar size_in_bytes: Size of the topic, in bytes. - :vartype size_in_bytes: int - :ivar created_at: Exact time the message was created. - :vartype created_at: ~datetime.datetime - :ivar updated_at: The exact time the message was updated. - :vartype updated_at: ~datetime.datetime - :ivar accessed_at: Last time the message was sent, or a request was received, for this topic. - :vartype accessed_at: ~datetime.datetime - :ivar subscription_count: Number of subscriptions. - :vartype subscription_count: int - :ivar count_details: Message count details. - :vartype count_details: ~azure.mgmt.servicebus.v2021_11_01.models.MessageCountDetails - :ivar default_message_time_to_live: ISO 8601 Default message timespan to live value. This is - the duration after which the message expires, starting from when the message is sent to Service - Bus. This is the default value used when TimeToLive is not set on a message itself. - :vartype default_message_time_to_live: ~datetime.timedelta - :ivar max_size_in_megabytes: Maximum size of the topic in megabytes, which is the size of the - memory allocated for the topic. Default is 1024. - :vartype max_size_in_megabytes: int - :ivar max_message_size_in_kilobytes: Maximum size (in KB) of the message payload that can be - accepted by the topic. This property is only used in Premium today and default is 1024. - :vartype max_message_size_in_kilobytes: int - :ivar requires_duplicate_detection: Value indicating if this topic requires duplicate - detection. - :vartype requires_duplicate_detection: bool - :ivar duplicate_detection_history_time_window: ISO8601 timespan structure that defines the - duration of the duplicate detection history. The default value is 10 minutes. - :vartype duplicate_detection_history_time_window: ~datetime.timedelta - :ivar enable_batched_operations: Value that indicates whether server-side batched operations - are enabled. - :vartype enable_batched_operations: bool - :ivar status: Enumerates the possible values for the status of a messaging entity. Known values - are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", - "Deleting", "Renaming", and "Unknown". - :vartype status: str or ~azure.mgmt.servicebus.v2021_11_01.models.EntityStatus - :ivar support_ordering: Value that indicates whether the topic supports ordering. - :vartype support_ordering: bool - :ivar auto_delete_on_idle: ISO 8601 timespan idle interval after which the topic is - automatically deleted. The minimum duration is 5 minutes. - :vartype auto_delete_on_idle: ~datetime.timedelta - :ivar enable_partitioning: Value that indicates whether the topic to be partitioned across - multiple message brokers is enabled. - :vartype enable_partitioning: bool - :ivar enable_express: Value that indicates whether Express Entities are enabled. An express - topic holds a message in memory temporarily before writing it to persistent storage. - :vartype enable_express: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "system_data": {"readonly": True}, - "size_in_bytes": {"readonly": True}, - "created_at": {"readonly": True}, - "updated_at": {"readonly": True}, - "accessed_at": {"readonly": True}, - "subscription_count": {"readonly": True}, - "count_details": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "size_in_bytes": {"key": "properties.sizeInBytes", "type": "int"}, - "created_at": {"key": "properties.createdAt", "type": "iso-8601"}, - "updated_at": {"key": "properties.updatedAt", "type": "iso-8601"}, - "accessed_at": {"key": "properties.accessedAt", "type": "iso-8601"}, - "subscription_count": {"key": "properties.subscriptionCount", "type": "int"}, - "count_details": {"key": "properties.countDetails", "type": "MessageCountDetails"}, - "default_message_time_to_live": {"key": "properties.defaultMessageTimeToLive", "type": "duration"}, - "max_size_in_megabytes": {"key": "properties.maxSizeInMegabytes", "type": "int"}, - "max_message_size_in_kilobytes": {"key": "properties.maxMessageSizeInKilobytes", "type": "int"}, - "requires_duplicate_detection": {"key": "properties.requiresDuplicateDetection", "type": "bool"}, - "duplicate_detection_history_time_window": { - "key": "properties.duplicateDetectionHistoryTimeWindow", - "type": "duration", - }, - "enable_batched_operations": {"key": "properties.enableBatchedOperations", "type": "bool"}, - "status": {"key": "properties.status", "type": "str"}, - "support_ordering": {"key": "properties.supportOrdering", "type": "bool"}, - "auto_delete_on_idle": {"key": "properties.autoDeleteOnIdle", "type": "duration"}, - "enable_partitioning": {"key": "properties.enablePartitioning", "type": "bool"}, - "enable_express": {"key": "properties.enableExpress", "type": "bool"}, - } - - def __init__( - self, - *, - default_message_time_to_live: Optional[datetime.timedelta] = None, - max_size_in_megabytes: Optional[int] = None, - max_message_size_in_kilobytes: Optional[int] = None, - requires_duplicate_detection: Optional[bool] = None, - duplicate_detection_history_time_window: Optional[datetime.timedelta] = None, - enable_batched_operations: Optional[bool] = None, - status: Optional[Union[str, "_models.EntityStatus"]] = None, - support_ordering: Optional[bool] = None, - auto_delete_on_idle: Optional[datetime.timedelta] = None, - enable_partitioning: Optional[bool] = None, - enable_express: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword default_message_time_to_live: ISO 8601 Default message timespan to live value. This is - the duration after which the message expires, starting from when the message is sent to Service - Bus. This is the default value used when TimeToLive is not set on a message itself. - :paramtype default_message_time_to_live: ~datetime.timedelta - :keyword max_size_in_megabytes: Maximum size of the topic in megabytes, which is the size of - the memory allocated for the topic. Default is 1024. - :paramtype max_size_in_megabytes: int - :keyword max_message_size_in_kilobytes: Maximum size (in KB) of the message payload that can be - accepted by the topic. This property is only used in Premium today and default is 1024. - :paramtype max_message_size_in_kilobytes: int - :keyword requires_duplicate_detection: Value indicating if this topic requires duplicate - detection. - :paramtype requires_duplicate_detection: bool - :keyword duplicate_detection_history_time_window: ISO8601 timespan structure that defines the - duration of the duplicate detection history. The default value is 10 minutes. - :paramtype duplicate_detection_history_time_window: ~datetime.timedelta - :keyword enable_batched_operations: Value that indicates whether server-side batched operations - are enabled. - :paramtype enable_batched_operations: bool - :keyword status: Enumerates the possible values for the status of a messaging entity. Known - values are: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", - "Deleting", "Renaming", and "Unknown". - :paramtype status: str or ~azure.mgmt.servicebus.v2021_11_01.models.EntityStatus - :keyword support_ordering: Value that indicates whether the topic supports ordering. - :paramtype support_ordering: bool - :keyword auto_delete_on_idle: ISO 8601 timespan idle interval after which the topic is - automatically deleted. The minimum duration is 5 minutes. - :paramtype auto_delete_on_idle: ~datetime.timedelta - :keyword enable_partitioning: Value that indicates whether the topic to be partitioned across - multiple message brokers is enabled. - :paramtype enable_partitioning: bool - :keyword enable_express: Value that indicates whether Express Entities are enabled. An express - topic holds a message in memory temporarily before writing it to persistent storage. - :paramtype enable_express: bool - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.size_in_bytes: Optional[int] = None - self.created_at: Optional[datetime.datetime] = None - self.updated_at: Optional[datetime.datetime] = None - self.accessed_at: Optional[datetime.datetime] = None - self.subscription_count: Optional[int] = None - self.count_details: Optional["_models.MessageCountDetails"] = None - self.default_message_time_to_live = default_message_time_to_live - self.max_size_in_megabytes = max_size_in_megabytes - self.max_message_size_in_kilobytes = max_message_size_in_kilobytes - self.requires_duplicate_detection = requires_duplicate_detection - self.duplicate_detection_history_time_window = duplicate_detection_history_time_window - self.enable_batched_operations = enable_batched_operations - self.status = status - self.support_ordering = support_ordering - self.auto_delete_on_idle = auto_delete_on_idle - self.enable_partitioning = enable_partitioning - self.enable_express = enable_express - - -class SBTopicListResult(_serialization.Model): - """The response to the List Topics operation. - - :ivar value: Result of the List Topics operation. - :vartype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBTopic] - :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list - of topics. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[SBTopic]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.SBTopic"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: Result of the List Topics operation. - :paramtype value: list[~azure.mgmt.servicebus.v2021_11_01.models.SBTopic] - :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete - list of topics. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SqlFilter(_serialization.Model): - """Represents a filter which is a composition of an expression and an action that is executed in - the pub/sub pipeline. - - :ivar sql_expression: The SQL expression. e.g. MyProperty='ABC'. - :vartype sql_expression: str - :ivar compatibility_level: This property is reserved for future use. An integer value showing - the compatibility level, currently hard-coded to 20. - :vartype compatibility_level: int - :ivar requires_preprocessing: Value that indicates whether the rule action requires - preprocessing. - :vartype requires_preprocessing: bool - """ - - _attribute_map = { - "sql_expression": {"key": "sqlExpression", "type": "str"}, - "compatibility_level": {"key": "compatibilityLevel", "type": "int"}, - "requires_preprocessing": {"key": "requiresPreprocessing", "type": "bool"}, - } - - def __init__( - self, - *, - sql_expression: Optional[str] = None, - compatibility_level: Optional[int] = None, - requires_preprocessing: bool = True, - **kwargs: Any - ) -> None: - """ - :keyword sql_expression: The SQL expression. e.g. MyProperty='ABC'. - :paramtype sql_expression: str - :keyword compatibility_level: This property is reserved for future use. An integer value - showing the compatibility level, currently hard-coded to 20. - :paramtype compatibility_level: int - :keyword requires_preprocessing: Value that indicates whether the rule action requires - preprocessing. - :paramtype requires_preprocessing: bool - """ - super().__init__(**kwargs) - self.sql_expression = sql_expression - self.compatibility_level = compatibility_level - self.requires_preprocessing = requires_preprocessing - - -class SqlRuleAction(Action): - """Represents set of actions written in SQL language-based syntax that is performed against a - ServiceBus.Messaging.BrokeredMessage. - - :ivar sql_expression: SQL expression. e.g. MyProperty='ABC'. - :vartype sql_expression: str - :ivar compatibility_level: This property is reserved for future use. An integer value showing - the compatibility level, currently hard-coded to 20. - :vartype compatibility_level: int - :ivar requires_preprocessing: Value that indicates whether the rule action requires - preprocessing. - :vartype requires_preprocessing: bool - """ - - -class Subnet(_serialization.Model): - """Properties supplied for Subnet. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID of Virtual Network Subnet. Required. - :vartype id: str - """ - - _validation = { - "id": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Resource ID of Virtual Network Subnet. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.servicebus.v2021_11_01.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.servicebus.v2021_11_01.models.CreatedByType - :ivar last_modified_at: The type of identity that last modified the resource. - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.servicebus.v2021_11_01.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or - ~azure.mgmt.servicebus.v2021_11_01.models.CreatedByType - :keyword last_modified_at: The type of identity that last modified the resource. - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class UserAssignedIdentity(_serialization.Model): - """Recognized Dictionary value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: Principal Id of user assigned identity. - :vartype principal_id: str - :ivar client_id: Client Id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.principal_id: Optional[str] = None - self.client_id: Optional[str] = None - - -class UserAssignedIdentityProperties(_serialization.Model): - """UserAssignedIdentityProperties. - - :ivar user_assigned_identity: ARM ID of user Identity selected for encryption. - :vartype user_assigned_identity: str - """ - - _attribute_map = { - "user_assigned_identity": {"key": "userAssignedIdentity", "type": "str"}, - } - - def __init__(self, *, user_assigned_identity: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword user_assigned_identity: ARM ID of user Identity selected for encryption. - :paramtype user_assigned_identity: str - """ - super().__init__(**kwargs) - self.user_assigned_identity = user_assigned_identity diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_service_bus_management_client_enums.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_service_bus_management_client_enums.py deleted file mode 100644 index ce716a014719..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/models/_service_bus_management_client_enums.py +++ /dev/null @@ -1,157 +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 AccessRights(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AccessRights.""" - - MANAGE = "Manage" - SEND = "Send" - LISTEN = "Listen" - - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - - -class DefaultAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Default Action for Network Rule Set.""" - - ALLOW = "Allow" - DENY = "Deny" - - -class EndPointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of the Private Endpoint Connection.""" - - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - SUCCEEDED = "Succeeded" - CANCELED = "Canceled" - FAILED = "Failed" - - -class EntityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Entity status.""" - - ACTIVE = "Active" - DISABLED = "Disabled" - RESTORING = "Restoring" - SEND_DISABLED = "SendDisabled" - RECEIVE_DISABLED = "ReceiveDisabled" - CREATING = "Creating" - DELETING = "Deleting" - RENAMING = "Renaming" - UNKNOWN = "Unknown" - - -class FilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Rule filter types.""" - - SQL_FILTER = "SqlFilter" - CORRELATION_FILTER = "CorrelationFilter" - - -class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The access key to regenerate.""" - - PRIMARY_KEY = "PrimaryKey" - SECONDARY_KEY = "SecondaryKey" - - -class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of managed service identity.""" - - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" - NONE = "None" - - -class MigrationConfigurationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """MigrationConfigurationName.""" - - _DEFAULT = "$default" - - -class NetworkRuleIPAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The IP Filter Action.""" - - ALLOW = "Allow" - - -class PrivateLinkConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the connection.""" - - PENDING = "Pending" - APPROVED = "Approved" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - - -class ProvisioningStateDR(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' - or 'Succeeded' or 'Failed'. - """ - - ACCEPTED = "Accepted" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - - -class PublicNetworkAccessFlag(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This determines if traffic is allowed over public network. By default it is enabled.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class RoleDisasterRecovery(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or - 'Secondary'. - """ - - PRIMARY = "Primary" - PRIMARY_NOT_REPLICATING = "PrimaryNotReplicating" - SECONDARY = "Secondary" - - -class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of this SKU.""" - - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - - -class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The billing tier of this particular SKU.""" - - BASIC = "Basic" - STANDARD = "Standard" - PREMIUM = "Premium" - - -class UnavailableReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the reason for the unavailability of the service.""" - - NONE = "None" - INVALID_NAME = "InvalidName" - SUBSCRIPTION_IS_DISABLED = "SubscriptionIsDisabled" - NAME_IN_USE = "NameInUse" - NAME_IN_LOCKDOWN = "NameInLockdown" - TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION = "TooManyNamespaceInCurrentSubscription" diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/py.typed b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_11_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/__init__.py deleted file mode 100644 index d4f6b2f73883..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_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 ._service_bus_management_client import ServiceBusManagementClient # 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__ = [ - "ServiceBusManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_configuration.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_configuration.py deleted file mode 100644 index 603089ae43fc..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_configuration.py +++ /dev/null @@ -1,65 +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 ServiceBusManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for ServiceBusManagementClient. - - 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: Subscription credentials that uniquely identify a Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-10-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", "2022-10-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-servicebus/{}".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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_metadata.json b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_metadata.json deleted file mode 100644 index 59272085f7e7..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_metadata.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "chosen_version": "2022-10-01-preview", - "total_api_version_list": ["2022-10-01-preview"], - "client": { - "name": "ServiceBusManagementClient", - "filename": "_service_bus_management_client", - "description": "Azure Service Bus client for managing Namespace.", - "host_value": null, - "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.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ServiceBusManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"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.core.settings\": [\"settings\"], \"azure.mgmt.core.tools\": [\"get_arm_endpoints\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"stdlib\": {\"typing\": [\"Optional\", \"cast\"], \"typing_extensions\": [\"Self\"]}, \"local\": {\"._configuration\": [\"ServiceBusManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"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": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. 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": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. 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: Optional[str] = None,", - "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: Optional[str] = None,", - "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": { - "namespaces": "NamespacesOperations", - "private_endpoint_connections": "PrivateEndpointConnectionsOperations", - "private_link_resources": "PrivateLinkResourcesOperations", - "operations": "Operations", - "disaster_recovery_configs": "DisasterRecoveryConfigsOperations", - "migration_configs": "MigrationConfigsOperations", - "queues": "QueuesOperations", - "topics": "TopicsOperations", - "rules": "RulesOperations", - "subscriptions": "SubscriptionsOperations" - } -} diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_service_bus_management_client.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_service_bus_management_client.py deleted file mode 100644 index 1c6ff8ac7c53..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_service_bus_management_client.py +++ /dev/null @@ -1,179 +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, 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.mgmt.core.tools import get_arm_endpoints - -from . import models as _models -from .._serialization import Deserializer, Serializer -from ._configuration import ServiceBusManagementClientConfiguration -from .operations import ( - DisasterRecoveryConfigsOperations, - MigrationConfigsOperations, - NamespacesOperations, - Operations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QueuesOperations, - RulesOperations, - SubscriptionsOperations, - TopicsOperations, -) - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class ServiceBusManagementClient: # pylint: disable=too-many-instance-attributes - """Azure Service Bus client for managing Namespace. - - :ivar namespaces: NamespacesOperations operations - :vartype namespaces: azure.mgmt.servicebus.v2022_10_01_preview.operations.NamespacesOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.servicebus.v2022_10_01_preview.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.servicebus.v2022_10_01_preview.operations.PrivateLinkResourcesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.servicebus.v2022_10_01_preview.operations.Operations - :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations - :vartype disaster_recovery_configs: - azure.mgmt.servicebus.v2022_10_01_preview.operations.DisasterRecoveryConfigsOperations - :ivar migration_configs: MigrationConfigsOperations operations - :vartype migration_configs: - azure.mgmt.servicebus.v2022_10_01_preview.operations.MigrationConfigsOperations - :ivar queues: QueuesOperations operations - :vartype queues: azure.mgmt.servicebus.v2022_10_01_preview.operations.QueuesOperations - :ivar topics: TopicsOperations operations - :vartype topics: azure.mgmt.servicebus.v2022_10_01_preview.operations.TopicsOperations - :ivar rules: RulesOperations operations - :vartype rules: azure.mgmt.servicebus.v2022_10_01_preview.operations.RulesOperations - :ivar subscriptions: SubscriptionsOperations operations - :vartype subscriptions: - azure.mgmt.servicebus.v2022_10_01_preview.operations.SubscriptionsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is None. - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-10-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: 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 = ServiceBusManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs - ) - - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - ARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, 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.namespaces = NamespacesOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.migration_configs = MigrationConfigsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.queues = QueuesOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.topics = TopicsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.rules = RulesOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.subscriptions = SubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_version.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/_version.py deleted file mode 100644 index b77ac9246082..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_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 = "9.0.0" diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/__init__.py deleted file mode 100644 index 39948e536385..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_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 ._service_bus_management_client import ServiceBusManagementClient # 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__ = [ - "ServiceBusManagementClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_configuration.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_configuration.py deleted file mode 100644 index 8d0a955e908f..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_configuration.py +++ /dev/null @@ -1,65 +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 ServiceBusManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for ServiceBusManagementClient. - - 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: Subscription credentials that uniquely identify a Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-10-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", "2022-10-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-servicebus/{}".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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_service_bus_management_client.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_service_bus_management_client.py deleted file mode 100644 index 820fa0553a38..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/_service_bus_management_client.py +++ /dev/null @@ -1,184 +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, 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.mgmt.core.tools import get_arm_endpoints - -from .. import models as _models -from ..._serialization import Deserializer, Serializer -from ._configuration import ServiceBusManagementClientConfiguration -from .operations import ( - DisasterRecoveryConfigsOperations, - MigrationConfigsOperations, - NamespacesOperations, - Operations, - PrivateEndpointConnectionsOperations, - PrivateLinkResourcesOperations, - QueuesOperations, - RulesOperations, - SubscriptionsOperations, - TopicsOperations, -) - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class ServiceBusManagementClient: # pylint: disable=too-many-instance-attributes - """Azure Service Bus client for managing Namespace. - - :ivar namespaces: NamespacesOperations operations - :vartype namespaces: - azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.NamespacesOperations - :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: - azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.PrivateLinkResourcesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.Operations - :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations - :vartype disaster_recovery_configs: - azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.DisasterRecoveryConfigsOperations - :ivar migration_configs: MigrationConfigsOperations operations - :vartype migration_configs: - azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.MigrationConfigsOperations - :ivar queues: QueuesOperations operations - :vartype queues: azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.QueuesOperations - :ivar topics: TopicsOperations operations - :vartype topics: azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.TopicsOperations - :ivar rules: RulesOperations operations - :vartype rules: azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.RulesOperations - :ivar subscriptions: SubscriptionsOperations operations - :vartype subscriptions: - azure.mgmt.servicebus.v2022_10_01_preview.aio.operations.SubscriptionsOperations - :param credential: Credential needed for the client to connect to Azure. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure - subscription. The subscription ID forms part of the URI for every service call. Required. - :type subscription_id: str - :param base_url: Service URL. Default value is None. - :type base_url: str - :keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - """ - - def __init__( - self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **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 = ServiceBusManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs - ) - - _policies = kwargs.pop("policies", None) - if _policies is None: - _policies = [ - policies.RequestIdPolicy(**kwargs), - self._config.headers_policy, - self._config.user_agent_policy, - self._config.proxy_policy, - policies.ContentDecodePolicy(**kwargs), - AsyncARMAutoResourceProviderRegistrationPolicy(), - self._config.redirect_policy, - self._config.retry_policy, - self._config.authentication_policy, - self._config.custom_hook_policy, - self._config.logging_policy, - policies.DistributedTracingPolicy(**kwargs), - policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, - self._config.http_logging_policy, - ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( - base_url=cast(str, 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.namespaces = NamespacesOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.migration_configs = MigrationConfigsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.queues = QueuesOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.topics = TopicsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.rules = RulesOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-01-preview" - ) - self.subscriptions = SubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize, "2022-10-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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/__init__.py deleted file mode 100644 index 31c2040610e2..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,43 +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 ._namespaces_operations import NamespacesOperations # type: ignore -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore -from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore -from ._operations import Operations # type: ignore -from ._disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations # type: ignore -from ._migration_configs_operations import MigrationConfigsOperations # type: ignore -from ._queues_operations import QueuesOperations # type: ignore -from ._topics_operations import TopicsOperations # type: ignore -from ._rules_operations import RulesOperations # type: ignore -from ._subscriptions_operations import SubscriptionsOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "NamespacesOperations", - "PrivateEndpointConnectionsOperations", - "PrivateLinkResourcesOperations", - "Operations", - "DisasterRecoveryConfigsOperations", - "MigrationConfigsOperations", - "QueuesOperations", - "TopicsOperations", - "RulesOperations", - "SubscriptionsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_disaster_recovery_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_disaster_recovery_configs_operations.py deleted file mode 100644 index f610c09d8db0..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_disaster_recovery_configs_operations.py +++ /dev/null @@ -1,975 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -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 ...._serialization import Deserializer, Serializer -from ...operations._disaster_recovery_configs_operations import ( - build_break_pairing_request, - build_check_name_availability_request, - build_create_or_update_request, - build_delete_request, - build_fail_over_request, - build_get_authorization_rule_request, - build_get_request, - build_list_authorization_rules_request, - build_list_keys_request, - build_list_request, -) -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DisasterRecoveryConfigsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`disaster_recovery_configs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ArmDisasterRecovery"]: - """Gets all Alias(Disaster Recovery configurations). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either ArmDisasterRecovery or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.ArmDisasterRecoveryListResult] = 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( - resource_group_name=resource_group_name, - namespace_name=namespace_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("ArmDisasterRecoveryListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: _models.ArmDisasterRecovery, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArmDisasterRecovery: - """Creates or updates a new Alias(Disaster Recovery configuration). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). - Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArmDisasterRecovery: - """Creates or updates a new Alias(Disaster Recovery configuration). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). - 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: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: Union[_models.ArmDisasterRecovery, IO[bytes]], - **kwargs: Any - ) -> _models.ArmDisasterRecovery: - """Creates or updates a new Alias(Disaster Recovery configuration). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Is - either a ArmDisasterRecovery type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery or - IO[bytes] - :return: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArmDisasterRecovery] = 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, "ArmDisasterRecovery") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArmDisasterRecovery", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any) -> None: - """Deletes an Alias(Disaster Recovery configuration). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any - ) -> _models.ArmDisasterRecovery: - """Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :return: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.ArmDisasterRecovery] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArmDisasterRecovery", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def break_pairing(self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any) -> None: - """This operation disables the Disaster Recovery and stops replicating changes from primary to - secondary namespaces. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_break_pairing_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - async def fail_over( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: Optional[_models.FailoverProperties] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). - Default value is None. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.FailoverProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def fail_over( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). - Default value is None. - :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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def fail_over( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: Optional[Union[_models.FailoverProperties, IO[bytes]]] = None, - **kwargs: Any - ) -> None: - """Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Is - either a FailoverProperties type or a IO[bytes] type. Default value is None. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.FailoverProperties or - IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - if parameters is not None: - _json = self._serialize.body(parameters, "FailoverProperties") - else: - _json = None - - _request = build_fail_over_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_authorization_rules( - self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any - ) -> AsyncIterable["_models.SBAuthorizationRule"]: - """Gets the authorization rules for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639376.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRuleListResult] = 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_authorization_rules_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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("SBAuthorizationRuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_authorization_rule( - self, resource_group_name: str, namespace_name: str, alias: str, authorization_rule_name: str, **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Gets an authorization rule for a namespace by rule name. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639392.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) - - _request = build_get_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_keys( - self, resource_group_name: str, namespace_name: str, alias: str, authorization_rule_name: str, **kwargs: Any - ) -> _models.AccessKeys: - """Gets the primary and secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639398.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) - - _request = build_list_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def check_name_availability( - self, - resource_group_name: str, - namespace_name: str, - parameters: _models.CheckNameAvailability, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters to check availability of the given namespace name. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailability - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def check_name_availability( - self, - resource_group_name: str, - namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters to check availability of the given namespace name. 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: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def check_name_availability( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.CheckNameAvailability, IO[bytes]], - **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters to check availability of the given namespace name. Is either a - CheckNameAvailability type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailability or - IO[bytes] - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckNameAvailabilityResult] = 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, "CheckNameAvailability") - - _request = build_check_name_availability_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_migration_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_migration_configs_operations.py deleted file mode 100644 index 93af7305d570..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_migration_configs_operations.py +++ /dev/null @@ -1,632 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterable, 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, - 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 ...._serialization import Deserializer, Serializer -from ...operations._migration_configs_operations import ( - build_complete_migration_request, - build_create_and_start_migration_request, - build_delete_request, - build_get_request, - build_list_request, - build_revert_request, -) -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class MigrationConfigsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`migration_configs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.MigrationConfigProperties"]: - """Gets all migrationConfigurations. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either MigrationConfigProperties or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.MigrationConfigListResult] = 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( - resource_group_name=resource_group_name, - namespace_name=namespace_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("MigrationConfigListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _create_and_start_migration_initial( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - parameters: Union[_models.MigrationConfigProperties, 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 "2022-10-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, "MigrationConfigProperties") - - _request = build_create_and_start_migration_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_and_start_migration( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - parameters: _models.MigrationConfigProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MigrationConfigProperties]: - """Creates Migration configuration and starts migration of entities from Standard to Premium - namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :param parameters: Parameters required to create Migration Configuration. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties - :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 MigrationConfigProperties or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_and_start_migration( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MigrationConfigProperties]: - """Creates Migration configuration and starts migration of entities from Standard to Premium - namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :param parameters: Parameters required to create Migration Configuration. 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 MigrationConfigProperties or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_and_start_migration( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - parameters: Union[_models.MigrationConfigProperties, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.MigrationConfigProperties]: - """Creates Migration configuration and starts migration of entities from Standard to Premium - namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :param parameters: Parameters required to create Migration Configuration. Is either a - MigrationConfigProperties type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties - or IO[bytes] - :return: An instance of AsyncLROPoller that returns either MigrationConfigProperties or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MigrationConfigProperties] = 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_and_start_migration_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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("MigrationConfigProperties", 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.MigrationConfigProperties].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.MigrationConfigProperties]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - **kwargs: Any - ) -> None: - """Deletes a MigrationConfiguration. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - **kwargs: Any - ) -> _models.MigrationConfigProperties: - """Retrieves Migration Config. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :return: MigrationConfigProperties or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.MigrationConfigProperties] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MigrationConfigProperties", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def complete_migration( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - **kwargs: Any - ) -> None: - """This operation Completes Migration of entities by pointing the connection strings to Premium - namespace and any entities created after the operation will be under Premium Namespace. - CompleteMigration operation will fail when entity migration is in-progress. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_complete_migration_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def revert( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - **kwargs: Any - ) -> None: - """This operation reverts Migration. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_revert_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_namespaces_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_namespaces_operations.py deleted file mode 100644 index 55e30458d912..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_namespaces_operations.py +++ /dev/null @@ -1,1718 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterable, 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, - 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 ...._serialization import Deserializer, Serializer -from ...operations._namespaces_operations import ( - build_check_name_availability_request, - build_create_or_update_authorization_rule_request, - build_create_or_update_network_rule_set_request, - build_create_or_update_request, - build_delete_authorization_rule_request, - build_delete_request, - build_get_authorization_rule_request, - build_get_network_rule_set_request, - build_get_request, - build_list_authorization_rules_request, - build_list_by_resource_group_request, - build_list_keys_request, - build_list_network_rule_sets_request, - build_list_request, - build_regenerate_keys_request, - build_update_request, -) -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NamespacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`namespaces` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.SBNamespace"]: - """Gets all the available namespaces within the subscription, irrespective of the resource groups. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639412.aspx - - :return: An iterator like instance of either SBNamespace or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBNamespaceListResult] = 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, - 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("SBNamespaceListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.SBNamespace"]: - """Gets the available namespaces within a resource group. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639412.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :return: An iterator like instance of either SBNamespace or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBNamespaceListResult] = 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, - 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("SBNamespaceListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _create_or_update_initial( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.SBNamespace, 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 "2022-10-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, "SBNamespace") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - parameters: _models.SBNamespace, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SBNamespace]: - """Creates or updates a service namespace. Once created, this namespace's resource manifest is - immutable. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to create a namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace - :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 SBNamespace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SBNamespace]: - """Creates or updates a service namespace. Once created, this namespace's resource manifest is - immutable. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to create a namespace resource. 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 SBNamespace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.SBNamespace, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SBNamespace]: - """Creates or updates a service namespace. Once created, this namespace's resource manifest is - immutable. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to create a namespace resource. Is either a SBNamespace - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SBNamespace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBNamespace] = 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( - resource_group_name=resource_group_name, - namespace_name=namespace_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("SBNamespace", 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.SBNamespace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SBNamespace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, namespace_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 "2022-10-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes an existing namespace. This operation also removes all associated resources under the - namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639389.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_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 "2022-10-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( - resource_group_name=resource_group_name, - namespace_name=namespace_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(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.SBNamespace: - """Gets a description for the specified namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639379.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: SBNamespace or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBNamespace] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBNamespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - namespace_name: str, - parameters: _models.SBNamespaceUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[_models.SBNamespace]: - """Updates a service namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to update a namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespaceUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[_models.SBNamespace]: - """Updates a service namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to update a namespace resource. 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: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.SBNamespaceUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.SBNamespace]: - """Updates a service namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to update a namespace resource. Is either a - SBNamespaceUpdateParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespaceUpdateParameters - or IO[bytes] - :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace or None - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.SBNamespace]] = 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, "SBNamespaceUpdateParameters") - - _request = build_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - deserialized = self._deserialize("SBNamespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update_network_rule_set( - self, - resource_group_name: str, - namespace_name: str, - parameters: _models.NetworkRuleSet, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.NetworkRuleSet: - """Create or update NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: The Namespace IpFilterRule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update_network_rule_set( - self, - resource_group_name: str, - namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.NetworkRuleSet: - """Create or update NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: The Namespace IpFilterRule. 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: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update_network_rule_set( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.NetworkRuleSet, IO[bytes]], - **kwargs: Any - ) -> _models.NetworkRuleSet: - """Create or update NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: The Namespace IpFilterRule. Is either a NetworkRuleSet type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet or IO[bytes] - :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkRuleSet] = 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, "NetworkRuleSet") - - _request = build_create_or_update_network_rule_set_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkRuleSet", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_network_rule_set( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> _models.NetworkRuleSet: - """Gets NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.NetworkRuleSet] = kwargs.pop("cls", None) - - _request = build_get_network_rule_set_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkRuleSet", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_network_rule_sets( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NetworkRuleSet"]: - """Gets list of NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either NetworkRuleSet or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.NetworkRuleSetListResult] = 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_network_rule_sets_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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("NetworkRuleSetListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_authorization_rules( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SBAuthorizationRule"]: - """Gets the authorization rules for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639376.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRuleListResult] = 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_authorization_rules_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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("SBAuthorizationRuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: _models.SBAuthorizationRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates or updates an authorization rule for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639410.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates or updates an authorization rule for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639410.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. 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: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: Union[_models.SBAuthorizationRule, IO[bytes]], - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates or updates an authorization rule for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639410.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule or - IO[bytes] - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBAuthorizationRule] = 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, "SBAuthorizationRule") - - _request = build_create_or_update_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_authorization_rule( - self, resource_group_name: str, namespace_name: str, authorization_rule_name: str, **kwargs: Any - ) -> None: - """Deletes a namespace authorization rule. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639417.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get_authorization_rule( - self, resource_group_name: str, namespace_name: str, authorization_rule_name: str, **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Gets an authorization rule for a namespace by rule name. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639392.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) - - _request = build_get_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_keys( - self, resource_group_name: str, namespace_name: str, authorization_rule_name: str, **kwargs: Any - ) -> _models.AccessKeys: - """Gets the primary and secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639398.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) - - _request = build_list_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: _models.RegenerateAccessKeyParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt718977.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt718977.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. 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: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: Union[_models.RegenerateAccessKeyParameters, IO[bytes]], - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt718977.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Is either a - RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters or IO[bytes] - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessKeys] = 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, "RegenerateAccessKeyParameters") - - _request = build_regenerate_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def check_name_availability( - self, parameters: _models.CheckNameAvailability, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param parameters: Parameters to check availability of the given namespace name. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailability - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def check_name_availability( - self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param parameters: Parameters to check availability of the given namespace name. 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: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def check_name_availability( - self, parameters: Union[_models.CheckNameAvailability, IO[bytes]], **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param parameters: Parameters to check availability of the given namespace name. Is either a - CheckNameAvailability type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailability or - IO[bytes] - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckNameAvailabilityResult] = 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, "CheckNameAvailability") - - _request = build_check_name_availability_request( - 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_operations.py deleted file mode 100644 index 68595ce1ec74..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_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. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from typing import Any, AsyncIterable, 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, - 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 ...._serialization import Deserializer, Serializer -from ...operations._operations import build_list_request -from .._configuration import ServiceBusManagementClientConfiguration - -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.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - 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"]: - """Lists all of the available ServiceBus REST API operations. - - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_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 "2022-10-01-preview") - ) - cls: ClsType[_models.OperationListResult] = 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("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 1b3e3ee4224a..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,492 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterable, 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, - 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 ...._serialization import Deserializer, Serializer -from ...operations._private_endpoint_connections_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, -) -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PrivateEndpointConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnection"]: - """Gets the available PrivateEndpointConnections within a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639412.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either PrivateEndpointConnection or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.PrivateEndpointConnectionListResult] = 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( - resource_group_name=resource_group_name, - namespace_name=namespace_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("PrivateEndpointConnectionListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - private_endpoint_connection_name: str, - parameters: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Creates or updates PrivateEndpointConnections of service namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_name: str - :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to - namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - private_endpoint_connection_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Creates or updates PrivateEndpointConnections of service namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_name: str - :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to - namespace resource. 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: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Creates or updates PrivateEndpointConnections of service namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_name: str - :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to - namespace resource. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - or IO[bytes] - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = 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, "PrivateEndpointConnection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - private_endpoint_connection_name=private_endpoint_connection_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, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, namespace_name: str, private_endpoint_connection_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 "2022-10-01-preview") - ) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - private_endpoint_connection_name=private_endpoint_connection_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, namespace_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Private Endpoint Connection. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639389.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_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 "2022-10-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( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - private_endpoint_connection_name=private_endpoint_connection_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( - self, resource_group_name: str, namespace_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Gets a description for the specified Private Endpoint Connection. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639379.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - private_endpoint_connection_name=private_endpoint_connection_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index ee70fcb668b2..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,117 +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 collections.abc import MutableMapping -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core import AsyncPipelineClient -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 ...._serialization import Deserializer, Serializer -from ...operations._private_link_resources_operations import build_get_request -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PrivateLinkResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace_async - async def get( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> _models.PrivateLinkResourcesListResult: - """Gets lists of resources that supports Privatelinks. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639379.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateLinkResourcesListResult - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_queues_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_queues_operations.py deleted file mode 100644 index 53586a5ad277..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_queues_operations.py +++ /dev/null @@ -1,1066 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -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 ...._serialization import Deserializer, Serializer -from ...operations._queues_operations import ( - build_create_or_update_authorization_rule_request, - build_create_or_update_request, - build_delete_authorization_rule_request, - build_delete_request, - build_get_authorization_rule_request, - build_get_request, - build_list_authorization_rules_request, - build_list_by_namespace_request, - build_list_keys_request, - build_regenerate_keys_request, -) -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class QueuesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`queues` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_authorization_rules( - self, resource_group_name: str, namespace_name: str, queue_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SBAuthorizationRule"]: - """Gets all authorization rules for a queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705607.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRuleListResult] = 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_authorization_rules_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_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("SBAuthorizationRuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: _models.SBAuthorizationRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for a queue. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for a queue. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. 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: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: Union[_models.SBAuthorizationRule, IO[bytes]], - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for a queue. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule or - IO[bytes] - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBAuthorizationRule] = 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, "SBAuthorizationRule") - - _request = build_create_or_update_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> None: - """Deletes a queue authorization rule. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705609.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Gets an authorization rule for a queue by rule name. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705611.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) - - _request = build_get_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> _models.AccessKeys: - """Primary and secondary connection strings to the queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705608.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) - - _request = build_list_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: _models.RegenerateAccessKeyParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings to the queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705606.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings to the queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705606.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. 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: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: Union[_models.RegenerateAccessKeyParameters, IO[bytes]], - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings to the queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705606.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Is either a - RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters or IO[bytes] - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessKeys] = 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, "RegenerateAccessKeyParameters") - - _request = build_regenerate_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_namespace( - self, - resource_group_name: str, - namespace_name: str, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SBQueue"]: - """Gets the queues within a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639415.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. Default value is None. - :type skip: int - :param top: May be used to limit the number of results to the most recent N usageDetails. - Default value is None. - :type top: int - :return: An iterator like instance of either SBQueue or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBQueueListResult] = 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_namespace_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - skip=skip, - top=top, - 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("SBQueueListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - parameters: _models.SBQueue, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBQueue: - """Creates or updates a Service Bus queue. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639395.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param parameters: Parameters supplied to create or update a queue resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBQueue: - """Creates or updates a Service Bus queue. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639395.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param parameters: Parameters supplied to create or update a queue resource. 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: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - parameters: Union[_models.SBQueue, IO[bytes]], - **kwargs: Any - ) -> _models.SBQueue: - """Creates or updates a Service Bus queue. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639395.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param parameters: Parameters supplied to create or update a queue resource. Is either a - SBQueue type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue or IO[bytes] - :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBQueue] = 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, "SBQueue") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBQueue", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, namespace_name: str, queue_name: str, **kwargs: Any) -> None: - """Deletes a queue from the specified namespace in a resource group. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639411.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, namespace_name: str, queue_name: str, **kwargs: Any - ) -> _models.SBQueue: - """Returns a description for the specified queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639380.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBQueue] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBQueue", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_rules_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_rules_operations.py deleted file mode 100644 index 52a37f9f2dfb..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_rules_operations.py +++ /dev/null @@ -1,476 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -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 ...._serialization import Deserializer, Serializer -from ...operations._rules_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_subscriptions_request, -) -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class RulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_subscriptions( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.Rule"]: - """List all the rules within given topic-subscription. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. Default value is None. - :type skip: int - :param top: May be used to limit the number of results to the most recent N usageDetails. - Default value is None. - :type top: int - :return: An iterator like instance of either Rule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.RuleListResult] = 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_subscriptions_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_name, - subscription_id=self._config.subscription_id, - skip=skip, - top=top, - 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("RuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - parameters: _models.Rule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Rule: - """Creates a new rule and updates an existing rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :param parameters: Parameters supplied to create a rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Rule: - """Creates a new rule and updates an existing rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :param parameters: Parameters supplied to create a rule. 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: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - parameters: Union[_models.Rule, IO[bytes]], - **kwargs: Any - ) -> _models.Rule: - """Creates a new rule and updates an existing rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :param parameters: Parameters supplied to create a rule. Is either a Rule type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule or IO[bytes] - :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rule] = 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, "Rule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_name, - rule_name=rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Rule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - **kwargs: Any - ) -> None: - """Deletes an existing rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_name, - rule_name=rule_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - **kwargs: Any - ) -> _models.Rule: - """Retrieves the description for the specified rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.Rule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_name, - rule_name=rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Rule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_subscriptions_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_subscriptions_operations.py deleted file mode 100644 index 65aaa99e946c..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_subscriptions_operations.py +++ /dev/null @@ -1,462 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -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 ...._serialization import Deserializer, Serializer -from ...operations._subscriptions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_topic_request, -) -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`subscriptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_topic( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SBSubscription"]: - """List all the subscriptions under a specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639400.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. Default value is None. - :type skip: int - :param top: May be used to limit the number of results to the most recent N usageDetails. - Default value is None. - :type top: int - :return: An iterator like instance of either SBSubscription or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBSubscriptionListResult] = 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_topic_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_id=self._config.subscription_id, - skip=skip, - top=top, - 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("SBSubscriptionListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - parameters: _models.SBSubscription, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBSubscription: - """Creates a topic subscription. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param parameters: Parameters supplied to create a subscription resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBSubscription: - """Creates a topic subscription. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param parameters: Parameters supplied to create a subscription resource. 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: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - parameters: Union[_models.SBSubscription, IO[bytes]], - **kwargs: Any - ) -> _models.SBSubscription: - """Creates a topic subscription. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param parameters: Parameters supplied to create a subscription resource. Is either a - SBSubscription type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription or IO[bytes] - :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBSubscription] = 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, "SBSubscription") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBSubscription", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, namespace_name: str, topic_name: str, subscription_name: str, **kwargs: Any - ) -> None: - """Deletes a subscription from the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639381.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, namespace_name: str, topic_name: str, subscription_name: str, **kwargs: Any - ) -> _models.SBSubscription: - """Returns a subscription description for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639402.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBSubscription] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBSubscription", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_topics_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_topics_operations.py deleted file mode 100644 index 89a3d5fbe88a..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/aio/operations/_topics_operations.py +++ /dev/null @@ -1,1075 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -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 ...._serialization import Deserializer, Serializer -from ...operations._topics_operations import ( - build_create_or_update_authorization_rule_request, - build_create_or_update_request, - build_delete_authorization_rule_request, - build_delete_request, - build_get_authorization_rule_request, - build_get_request, - build_list_authorization_rules_request, - build_list_by_namespace_request, - build_list_keys_request, - build_regenerate_keys_request, -) -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class TopicsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.aio.ServiceBusManagementClient`'s - :attr:`topics` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_authorization_rules( - self, resource_group_name: str, namespace_name: str, topic_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SBAuthorizationRule"]: - """Gets authorization rules for a topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720681.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRuleListResult] = 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_authorization_rules_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_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("SBAuthorizationRuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: _models.SBAuthorizationRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720678.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720678.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. 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: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: Union[_models.SBAuthorizationRule, IO[bytes]], - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720678.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule or - IO[bytes] - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBAuthorizationRule] = 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, "SBAuthorizationRule") - - _request = build_create_or_update_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Returns the specified authorization rule. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720676.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) - - _request = build_get_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> None: - """Deletes a topic authorization rule. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720681.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def list_keys( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> _models.AccessKeys: - """Gets the primary and secondary connection strings for the topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720677.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) - - _request = build_list_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: _models.RegenerateAccessKeyParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates primary or secondary connection strings for the topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720679.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates primary or secondary connection strings for the topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720679.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. 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: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: Union[_models.RegenerateAccessKeyParameters, IO[bytes]], - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates primary or secondary connection strings for the topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720679.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Is either a - RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters or IO[bytes] - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessKeys] = 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, "RegenerateAccessKeyParameters") - - _request = build_regenerate_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_namespace( - self, - resource_group_name: str, - namespace_name: str, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.SBTopic"]: - """Gets all the topics in a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639388.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. Default value is None. - :type skip: int - :param top: May be used to limit the number of results to the most recent N usageDetails. - Default value is None. - :type top: int - :return: An iterator like instance of either SBTopic or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBTopicListResult] = 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_namespace_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - skip=skip, - top=top, - 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("SBTopicListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - parameters: _models.SBTopic, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBTopic: - """Creates a topic in the specified namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639409.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param parameters: Parameters supplied to create a topic resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBTopic: - """Creates a topic in the specified namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639409.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param parameters: Parameters supplied to create a topic resource. 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: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - parameters: Union[_models.SBTopic, IO[bytes]], - **kwargs: Any - ) -> _models.SBTopic: - """Creates a topic in the specified namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639409.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param parameters: Parameters supplied to create a topic resource. Is either a SBTopic type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic or IO[bytes] - :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBTopic] = 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, "SBTopic") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBTopic", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, namespace_name: str, topic_name: str, **kwargs: Any) -> None: - """Deletes a topic from the specified namespace and resource group. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639404.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, namespace_name: str, topic_name: str, **kwargs: Any - ) -> _models.SBTopic: - """Returns a description for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639399.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBTopic] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBTopic", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/models/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/__init__.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/__init__.py deleted file mode 100644 index 31c2040610e2..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/__init__.py +++ /dev/null @@ -1,43 +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 ._namespaces_operations import NamespacesOperations # type: ignore -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore -from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore -from ._operations import Operations # type: ignore -from ._disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations # type: ignore -from ._migration_configs_operations import MigrationConfigsOperations # type: ignore -from ._queues_operations import QueuesOperations # type: ignore -from ._topics_operations import TopicsOperations # type: ignore -from ._rules_operations import RulesOperations # type: ignore -from ._subscriptions_operations import SubscriptionsOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "NamespacesOperations", - "PrivateEndpointConnectionsOperations", - "PrivateLinkResourcesOperations", - "Operations", - "DisasterRecoveryConfigsOperations", - "MigrationConfigsOperations", - "QueuesOperations", - "TopicsOperations", - "RulesOperations", - "SubscriptionsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_disaster_recovery_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_disaster_recovery_configs_operations.py deleted file mode 100644 index 4fb79a8eda52..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_disaster_recovery_configs_operations.py +++ /dev/null @@ -1,1333 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -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( - resource_group_name: str, namespace_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # 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( - resource_group_name: str, namespace_name: str, alias: 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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "alias": _SERIALIZER.url("alias", alias, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, namespace_name: str, alias: 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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "alias": _SERIALIZER.url("alias", alias, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, namespace_name: str, alias: 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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "alias": _SERIALIZER.url("alias", alias, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_break_pairing_request( - resource_group_name: str, namespace_name: str, alias: 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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "alias": _SERIALIZER.url("alias", alias, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_fail_over_request( - resource_group_name: str, namespace_name: str, alias: 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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "alias": _SERIALIZER.url("alias", alias, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_authorization_rules_request( - resource_group_name: str, namespace_name: str, alias: 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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "alias": _SERIALIZER.url("alias", alias, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_authorization_rule_request( - resource_group_name: str, - namespace_name: str, - alias: str, - authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "alias": _SERIALIZER.url("alias", alias, "str", max_length=50, min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_keys_request( - resource_group_name: str, - namespace_name: str, - alias: str, - authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}/listKeys", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "alias": _SERIALIZER.url("alias", alias, "str", max_length=50, min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_check_name_availability_request( - resource_group_name: str, namespace_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/CheckNameAvailability", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # 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 DisasterRecoveryConfigsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`disaster_recovery_configs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.ArmDisasterRecovery"]: - """Gets all Alias(Disaster Recovery configurations). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either ArmDisasterRecovery or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.ArmDisasterRecoveryListResult] = 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( - resource_group_name=resource_group_name, - namespace_name=namespace_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("ArmDisasterRecoveryListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: _models.ArmDisasterRecovery, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArmDisasterRecovery: - """Creates or updates a new Alias(Disaster Recovery configuration). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). - Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArmDisasterRecovery: - """Creates or updates a new Alias(Disaster Recovery configuration). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). - 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: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: Union[_models.ArmDisasterRecovery, IO[bytes]], - **kwargs: Any - ) -> _models.ArmDisasterRecovery: - """Creates or updates a new Alias(Disaster Recovery configuration). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Is - either a ArmDisasterRecovery type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery or - IO[bytes] - :return: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArmDisasterRecovery] = 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, "ArmDisasterRecovery") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArmDisasterRecovery", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any - ) -> None: - """Deletes an Alias(Disaster Recovery configuration). - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any - ) -> _models.ArmDisasterRecovery: - """Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :return: ArmDisasterRecovery or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.ArmDisasterRecovery - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.ArmDisasterRecovery] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArmDisasterRecovery", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def break_pairing( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any - ) -> None: - """This operation disables the Disaster Recovery and stops replicating changes from primary to - secondary namespaces. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_break_pairing_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @overload - def fail_over( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: Optional[_models.FailoverProperties] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). - Default value is None. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.FailoverProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def fail_over( - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). - Default value is None. - :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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def fail_over( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - namespace_name: str, - alias: str, - parameters: Optional[Union[_models.FailoverProperties, IO[bytes]]] = None, - **kwargs: Any - ) -> None: - """Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). Is - either a FailoverProperties type or a IO[bytes] type. Default value is None. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.FailoverProperties or - IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - if parameters is not None: - _json = self._serialize.body(parameters, "FailoverProperties") - else: - _json = None - - _request = build_fail_over_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_authorization_rules( - self, resource_group_name: str, namespace_name: str, alias: str, **kwargs: Any - ) -> Iterable["_models.SBAuthorizationRule"]: - """Gets the authorization rules for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639376.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRuleListResult] = 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_authorization_rules_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - 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("SBAuthorizationRuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_authorization_rule( - self, resource_group_name: str, namespace_name: str, alias: str, authorization_rule_name: str, **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Gets an authorization rule for a namespace by rule name. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639392.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) - - _request = build_get_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_keys( - self, resource_group_name: str, namespace_name: str, alias: str, authorization_rule_name: str, **kwargs: Any - ) -> _models.AccessKeys: - """Gets the primary and secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639398.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param alias: The Disaster Recovery configuration name. Required. - :type alias: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) - - _request = build_list_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - alias=alias, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def check_name_availability( - self, - resource_group_name: str, - namespace_name: str, - parameters: _models.CheckNameAvailability, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters to check availability of the given namespace name. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailability - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def check_name_availability( - self, - resource_group_name: str, - namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters to check availability of the given namespace name. 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: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def check_name_availability( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.CheckNameAvailability, IO[bytes]], - **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters to check availability of the given namespace name. Is either a - CheckNameAvailability type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailability or - IO[bytes] - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckNameAvailabilityResult] = 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, "CheckNameAvailability") - - _request = build_check_name_availability_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_migration_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_migration_configs_operations.py deleted file mode 100644 index 7939fae451ac..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_migration_configs_operations.py +++ /dev/null @@ -1,852 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -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( - resource_group_name: str, namespace_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_and_start_migration_request( - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - 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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "configName": _SERIALIZER.url("config_name", config_name, "str"), - "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") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - 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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "configName": _SERIALIZER.url("config_name", config_name, "str"), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - 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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "configName": _SERIALIZER.url("config_name", config_name, "str"), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_complete_migration_request( - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - 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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "configName": _SERIALIZER.url("config_name", config_name, "str"), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_revert_request( - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - 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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/revert", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "configName": _SERIALIZER.url("config_name", config_name, "str"), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class MigrationConfigsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`migration_configs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.MigrationConfigProperties"]: - """Gets all migrationConfigurations. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either MigrationConfigProperties or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.MigrationConfigListResult] = 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( - resource_group_name=resource_group_name, - namespace_name=namespace_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("MigrationConfigListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _create_and_start_migration_initial( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - parameters: Union[_models.MigrationConfigProperties, 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 "2022-10-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, "MigrationConfigProperties") - - _request = build_create_and_start_migration_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_and_start_migration( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - parameters: _models.MigrationConfigProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MigrationConfigProperties]: - """Creates Migration configuration and starts migration of entities from Standard to Premium - namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :param parameters: Parameters required to create Migration Configuration. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties - :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 MigrationConfigProperties or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_and_start_migration( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MigrationConfigProperties]: - """Creates Migration configuration and starts migration of entities from Standard to Premium - namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :param parameters: Parameters required to create Migration Configuration. 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 MigrationConfigProperties or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_and_start_migration( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - parameters: Union[_models.MigrationConfigProperties, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.MigrationConfigProperties]: - """Creates Migration configuration and starts migration of entities from Standard to Premium - namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :param parameters: Parameters required to create Migration Configuration. Is either a - MigrationConfigProperties type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties - or IO[bytes] - :return: An instance of LROPoller that returns either MigrationConfigProperties or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties] - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MigrationConfigProperties] = 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_and_start_migration_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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("MigrationConfigProperties", 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.MigrationConfigProperties].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.MigrationConfigProperties]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - **kwargs: Any - ) -> None: - """Deletes a MigrationConfiguration. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - **kwargs: Any - ) -> _models.MigrationConfigProperties: - """Retrieves Migration Config. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :return: MigrationConfigProperties or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigProperties - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.MigrationConfigProperties] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MigrationConfigProperties", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def complete_migration( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - **kwargs: Any - ) -> None: - """This operation Completes Migration of entities by pointing the connection strings to Premium - namespace and any entities created after the operation will be under Premium Namespace. - CompleteMigration operation will fail when entity migration is in-progress. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_complete_migration_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def revert( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - namespace_name: str, - config_name: Union[str, _models.MigrationConfigurationName], - **kwargs: Any - ) -> None: - """This operation reverts Migration. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param config_name: The configuration name. Should always be "$default". "$default" Required. - :type config_name: str or - ~azure.mgmt.servicebus.v2022_10_01_preview.models.MigrationConfigurationName - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_revert_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - config_name=config_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_namespaces_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_namespaces_operations.py deleted file mode 100644 index 2eee1462dd09..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_namespaces_operations.py +++ /dev/null @@ -1,2242 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -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, **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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces") - 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") - - # 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, **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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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( - resource_group_name: str, namespace_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "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") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, namespace_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, namespace_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, namespace_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # 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_create_or_update_network_rule_set_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # 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_get_network_rule_set_request( - resource_group_name: str, namespace_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets/default", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_network_rule_sets_request( - resource_group_name: str, namespace_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_authorization_rules_request( - resource_group_name: str, namespace_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # 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_authorization_rule_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, authorization_rule_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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_authorization_rule_request( - resource_group_name: str, namespace_name: str, authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_authorization_rule_request( - resource_group_name: str, namespace_name: str, authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_keys_request( - resource_group_name: str, namespace_name: str, authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_regenerate_keys_request( - resource_group_name: str, namespace_name: str, authorization_rule_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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_check_name_availability_request(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", "2022-10-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/CheckNameAvailability" - ) - 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") - - # 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 NamespacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`namespaces` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.SBNamespace"]: - """Gets all the available namespaces within the subscription, irrespective of the resource groups. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639412.aspx - - :return: An iterator like instance of either SBNamespace or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBNamespaceListResult] = 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, - 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("SBNamespaceListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.SBNamespace"]: - """Gets the available namespaces within a resource group. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639412.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :return: An iterator like instance of either SBNamespace or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBNamespaceListResult] = 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, - 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("SBNamespaceListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _create_or_update_initial( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.SBNamespace, 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 "2022-10-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, "SBNamespace") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - parameters: _models.SBNamespace, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SBNamespace]: - """Creates or updates a service namespace. Once created, this namespace's resource manifest is - immutable. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to create a namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace - :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 SBNamespace or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SBNamespace]: - """Creates or updates a service namespace. Once created, this namespace's resource manifest is - immutable. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to create a namespace resource. 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 SBNamespace or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.SBNamespace, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SBNamespace]: - """Creates or updates a service namespace. Once created, this namespace's resource manifest is - immutable. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to create a namespace resource. Is either a SBNamespace - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace or IO[bytes] - :return: An instance of LROPoller that returns either SBNamespace or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace] - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBNamespace] = 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( - resource_group_name=resource_group_name, - namespace_name=namespace_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("SBNamespace", 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.SBNamespace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SBNamespace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, namespace_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 "2022-10-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes an existing namespace. This operation also removes all associated resources under the - namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639389.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_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 "2022-10-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( - resource_group_name=resource_group_name, - namespace_name=namespace_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(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.SBNamespace: - """Gets a description for the specified namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639379.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: SBNamespace or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBNamespace] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBNamespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - namespace_name: str, - parameters: _models.SBNamespaceUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[_models.SBNamespace]: - """Updates a service namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to update a namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespaceUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[_models.SBNamespace]: - """Updates a service namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to update a namespace resource. 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: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.SBNamespaceUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.SBNamespace]: - """Updates a service namespace. Once created, this namespace's resource manifest is immutable. - This operation is idempotent. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: Parameters supplied to update a namespace resource. Is either a - SBNamespaceUpdateParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespaceUpdateParameters - or IO[bytes] - :return: SBNamespace or None or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBNamespace or None - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.SBNamespace]] = 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, "SBNamespaceUpdateParameters") - - _request = build_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - deserialized = self._deserialize("SBNamespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update_network_rule_set( - self, - resource_group_name: str, - namespace_name: str, - parameters: _models.NetworkRuleSet, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.NetworkRuleSet: - """Create or update NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: The Namespace IpFilterRule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update_network_rule_set( - self, - resource_group_name: str, - namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.NetworkRuleSet: - """Create or update NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: The Namespace IpFilterRule. 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: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update_network_rule_set( - self, - resource_group_name: str, - namespace_name: str, - parameters: Union[_models.NetworkRuleSet, IO[bytes]], - **kwargs: Any - ) -> _models.NetworkRuleSet: - """Create or update NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param parameters: The Namespace IpFilterRule. Is either a NetworkRuleSet type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet or IO[bytes] - :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NetworkRuleSet] = 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, "NetworkRuleSet") - - _request = build_create_or_update_network_rule_set_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkRuleSet", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_network_rule_set( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> _models.NetworkRuleSet: - """Gets NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: NetworkRuleSet or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.NetworkRuleSet] = kwargs.pop("cls", None) - - _request = build_get_network_rule_set_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkRuleSet", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_network_rule_sets( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.NetworkRuleSet"]: - """Gets list of NetworkRuleSet for a Namespace. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either NetworkRuleSet or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.NetworkRuleSet] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.NetworkRuleSetListResult] = 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_network_rule_sets_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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("NetworkRuleSetListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_authorization_rules( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.SBAuthorizationRule"]: - """Gets the authorization rules for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639376.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRuleListResult] = 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_authorization_rules_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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("SBAuthorizationRuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: _models.SBAuthorizationRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates or updates an authorization rule for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639410.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates or updates an authorization rule for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639410.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. 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: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: Union[_models.SBAuthorizationRule, IO[bytes]], - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates or updates an authorization rule for a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639410.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule or - IO[bytes] - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBAuthorizationRule] = 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, "SBAuthorizationRule") - - _request = build_create_or_update_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_authorization_rule( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, namespace_name: str, authorization_rule_name: str, **kwargs: Any - ) -> None: - """Deletes a namespace authorization rule. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639417.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get_authorization_rule( - self, resource_group_name: str, namespace_name: str, authorization_rule_name: str, **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Gets an authorization rule for a namespace by rule name. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639392.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) - - _request = build_get_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_keys( - self, resource_group_name: str, namespace_name: str, authorization_rule_name: str, **kwargs: Any - ) -> _models.AccessKeys: - """Gets the primary and secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639398.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) - - _request = build_list_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: _models.RegenerateAccessKeyParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt718977.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt718977.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. 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: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - authorization_rule_name: str, - parameters: Union[_models.RegenerateAccessKeyParameters, IO[bytes]], - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings for the namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt718977.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Is either a - RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters or IO[bytes] - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessKeys] = 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, "RegenerateAccessKeyParameters") - - _request = build_regenerate_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def check_name_availability( - self, parameters: _models.CheckNameAvailability, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param parameters: Parameters to check availability of the given namespace name. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailability - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def check_name_availability( - self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param parameters: Parameters to check availability of the given namespace name. 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: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def check_name_availability( - self, parameters: Union[_models.CheckNameAvailability, IO[bytes]], **kwargs: Any - ) -> _models.CheckNameAvailabilityResult: - """Check the give namespace name availability. - - :param parameters: Parameters to check availability of the given namespace name. Is either a - CheckNameAvailability type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailability or - IO[bytes] - :return: CheckNameAvailabilityResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.CheckNameAvailabilityResult - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckNameAvailabilityResult] = 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, "CheckNameAvailability") - - _request = build_check_name_availability_request( - 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_operations.py deleted file mode 100644 index 9a5b44bb6210..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_operations.py +++ /dev/null @@ -1,155 +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 collections.abc import MutableMapping -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.ServiceBus/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.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - 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"]: - """Lists all of the available ServiceBus REST API operations. - - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_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 "2022-10-01-preview") - ) - cls: ClsType[_models.OperationListResult] = 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("OperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_patch.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_patch.py deleted file mode 100644 index f7dd32510333..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_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/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 5fd1e3ce16b5..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,644 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -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( - resource_group_name: str, namespace_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # 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( - resource_group_name: str, - namespace_name: str, - private_endpoint_connection_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_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( - resource_group_name: str, - namespace_name: str, - private_endpoint_connection_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_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_get_request( - resource_group_name: str, - namespace_name: str, - private_endpoint_connection_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class PrivateEndpointConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> Iterable["_models.PrivateEndpointConnection"]: - """Gets the available PrivateEndpointConnections within a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639412.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: An iterator like instance of either PrivateEndpointConnection or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.PrivateEndpointConnectionListResult] = 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( - resource_group_name=resource_group_name, - namespace_name=namespace_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("PrivateEndpointConnectionListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - private_endpoint_connection_name: str, - parameters: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Creates or updates PrivateEndpointConnections of service namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_name: str - :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to - namespace resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - private_endpoint_connection_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Creates or updates PrivateEndpointConnections of service namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_name: str - :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to - namespace resource. 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: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Creates or updates PrivateEndpointConnections of service namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639408.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_name: str - :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to - namespace resource. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - or IO[bytes] - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = 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, "PrivateEndpointConnection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - private_endpoint_connection_name=private_endpoint_connection_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, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, namespace_name: str, private_endpoint_connection_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 "2022-10-01-preview") - ) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - private_endpoint_connection_name=private_endpoint_connection_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, namespace_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Private Endpoint Connection. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639389.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_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 "2022-10-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( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - private_endpoint_connection_name=private_endpoint_connection_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( - self, resource_group_name: str, namespace_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Gets a description for the specified Private Endpoint Connection. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639379.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param private_endpoint_connection_name: The PrivateEndpointConnection name. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateEndpointConnection - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - private_endpoint_connection_name=private_endpoint_connection_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_private_link_resources_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_private_link_resources_operations.py deleted file mode 100644 index 91dba2c45b9a..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,153 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -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, - 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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -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( - resource_group_name: str, namespace_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/privateLinkResources", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "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") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class PrivateLinkResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def get( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> _models.PrivateLinkResourcesListResult: - """Gets lists of resources that supports Privatelinks. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639379.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.PrivateLinkResourcesListResult - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_queues_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_queues_operations.py deleted file mode 100644 index 795efee48454..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_queues_operations.py +++ /dev/null @@ -1,1453 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_authorization_rules_request( - resource_group_name: str, namespace_name: str, queue_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "queueName": _SERIALIZER.url("queue_name", queue_name, "str", min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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_authorization_rule_request( # pylint: disable=name-too-long - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "queueName": _SERIALIZER.url("queue_name", queue_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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_authorization_rule_request( - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "queueName": _SERIALIZER.url("queue_name", queue_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_authorization_rule_request( - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "queueName": _SERIALIZER.url("queue_name", queue_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_keys_request( - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/ListKeys", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "queueName": _SERIALIZER.url("queue_name", queue_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_regenerate_keys_request( - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}/regenerateKeys", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "queueName": _SERIALIZER.url("queue_name", queue_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_namespace_request( - resource_group_name: str, - namespace_name: str, - subscription_id: str, - *, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int", maximum=1000, minimum=0) - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1) - - # 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( - resource_group_name: str, namespace_name: str, queue_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "queueName": _SERIALIZER.url("queue_name", queue_name, "str", min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, namespace_name: str, queue_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "queueName": _SERIALIZER.url("queue_name", queue_name, "str", min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, namespace_name: str, queue_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "queueName": _SERIALIZER.url("queue_name", queue_name, "str", min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class QueuesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`queues` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_authorization_rules( - self, resource_group_name: str, namespace_name: str, queue_name: str, **kwargs: Any - ) -> Iterable["_models.SBAuthorizationRule"]: - """Gets all authorization rules for a queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705607.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRuleListResult] = 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_authorization_rules_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_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("SBAuthorizationRuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: _models.SBAuthorizationRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for a queue. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for a queue. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. 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: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: Union[_models.SBAuthorizationRule, IO[bytes]], - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for a queue. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule or - IO[bytes] - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBAuthorizationRule] = 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, "SBAuthorizationRule") - - _request = build_create_or_update_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_authorization_rule( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> None: - """Deletes a queue authorization rule. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705609.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Gets an authorization rule for a queue by rule name. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705611.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) - - _request = build_get_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> _models.AccessKeys: - """Primary and secondary connection strings to the queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705608.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) - - _request = build_list_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: _models.RegenerateAccessKeyParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings to the queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705606.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings to the queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705606.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. 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: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - authorization_rule_name: str, - parameters: Union[_models.RegenerateAccessKeyParameters, IO[bytes]], - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates the primary or secondary connection strings to the queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt705606.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Is either a - RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters or IO[bytes] - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessKeys] = 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, "RegenerateAccessKeyParameters") - - _request = build_regenerate_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_namespace( - self, - resource_group_name: str, - namespace_name: str, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.SBQueue"]: - """Gets the queues within a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639415.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. Default value is None. - :type skip: int - :param top: May be used to limit the number of results to the most recent N usageDetails. - Default value is None. - :type top: int - :return: An iterator like instance of either SBQueue or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBQueueListResult] = 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_namespace_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - skip=skip, - top=top, - 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("SBQueueListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - parameters: _models.SBQueue, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBQueue: - """Creates or updates a Service Bus queue. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639395.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param parameters: Parameters supplied to create or update a queue resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBQueue: - """Creates or updates a Service Bus queue. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639395.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param parameters: Parameters supplied to create or update a queue resource. 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: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - queue_name: str, - parameters: Union[_models.SBQueue, IO[bytes]], - **kwargs: Any - ) -> _models.SBQueue: - """Creates or updates a Service Bus queue. This operation is idempotent. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639395.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :param parameters: Parameters supplied to create or update a queue resource. Is either a - SBQueue type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue or IO[bytes] - :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBQueue] = 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, "SBQueue") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBQueue", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, namespace_name: str, queue_name: str, **kwargs: Any - ) -> None: - """Deletes a queue from the specified namespace in a resource group. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639411.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, namespace_name: str, queue_name: str, **kwargs: Any) -> _models.SBQueue: - """Returns a description for the specified queue. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639380.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param queue_name: The queue name. Required. - :type queue_name: str - :return: SBQueue or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBQueue - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBQueue] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - queue_name=queue_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBQueue", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_rules_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_rules_operations.py deleted file mode 100644 index 252da210e744..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_rules_operations.py +++ /dev/null @@ -1,648 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -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_subscriptions_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - subscription_id: str, - *, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionName": _SERIALIZER.url("subscription_name", subscription_name, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int", maximum=1000, minimum=0) - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1) - - # 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( - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionName": _SERIALIZER.url("subscription_name", subscription_name, "str", max_length=50, min_length=1), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionName": _SERIALIZER.url("subscription_name", subscription_name, "str", max_length=50, min_length=1), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionName": _SERIALIZER.url("subscription_name", subscription_name, "str", max_length=50, min_length=1), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class RulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_subscriptions( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.Rule"]: - """List all the rules within given topic-subscription. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. Default value is None. - :type skip: int - :param top: May be used to limit the number of results to the most recent N usageDetails. - Default value is None. - :type top: int - :return: An iterator like instance of either Rule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.RuleListResult] = 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_subscriptions_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_name, - subscription_id=self._config.subscription_id, - skip=skip, - top=top, - 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("RuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - parameters: _models.Rule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Rule: - """Creates a new rule and updates an existing rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :param parameters: Parameters supplied to create a rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Rule: - """Creates a new rule and updates an existing rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :param parameters: Parameters supplied to create a rule. 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: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - parameters: Union[_models.Rule, IO[bytes]], - **kwargs: Any - ) -> _models.Rule: - """Creates a new rule and updates an existing rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :param parameters: Parameters supplied to create a rule. Is either a Rule type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule or IO[bytes] - :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Rule] = 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, "Rule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_name, - rule_name=rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Rule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - **kwargs: Any - ) -> None: - """Deletes an existing rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_name, - rule_name=rule_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - rule_name: str, - **kwargs: Any - ) -> _models.Rule: - """Retrieves the description for the specified rule. - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param rule_name: The rule name. Required. - :type rule_name: str - :return: Rule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.Rule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.Rule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_name, - rule_name=rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Rule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_subscriptions_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_subscriptions_operations.py deleted file mode 100644 index 913489731156..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_subscriptions_operations.py +++ /dev/null @@ -1,627 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -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_topic_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_id: str, - *, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int", maximum=1000, minimum=0) - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1) - - # 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( - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionName": _SERIALIZER.url("subscription_name", subscription_name, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionName": _SERIALIZER.url("subscription_name", subscription_name, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionName": _SERIALIZER.url("subscription_name", subscription_name, "str", max_length=50, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`subscriptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_by_topic( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.SBSubscription"]: - """List all the subscriptions under a specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639400.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. Default value is None. - :type skip: int - :param top: May be used to limit the number of results to the most recent N usageDetails. - Default value is None. - :type top: int - :return: An iterator like instance of either SBSubscription or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBSubscriptionListResult] = 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_topic_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_id=self._config.subscription_id, - skip=skip, - top=top, - 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("SBSubscriptionListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - parameters: _models.SBSubscription, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBSubscription: - """Creates a topic subscription. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param parameters: Parameters supplied to create a subscription resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBSubscription: - """Creates a topic subscription. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param parameters: Parameters supplied to create a subscription resource. 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: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - subscription_name: str, - parameters: Union[_models.SBSubscription, IO[bytes]], - **kwargs: Any - ) -> _models.SBSubscription: - """Creates a topic subscription. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639385.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :param parameters: Parameters supplied to create a subscription resource. Is either a - SBSubscription type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription or IO[bytes] - :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBSubscription] = 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, "SBSubscription") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBSubscription", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, namespace_name: str, topic_name: str, subscription_name: str, **kwargs: Any - ) -> None: - """Deletes a subscription from the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639381.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, namespace_name: str, topic_name: str, subscription_name: str, **kwargs: Any - ) -> _models.SBSubscription: - """Returns a subscription description for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639402.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param subscription_name: The subscription name. Required. - :type subscription_name: str - :return: SBSubscription or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBSubscription - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBSubscription] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - subscription_name=subscription_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBSubscription", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_topics_operations.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_topics_operations.py deleted file mode 100644 index f9d2f9254e71..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/operations/_topics_operations.py +++ /dev/null @@ -1,1462 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -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 Deserializer, Serializer -from .._configuration import ServiceBusManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_authorization_rules_request( - resource_group_name: str, namespace_name: str, topic_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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_authorization_rule_request( # pylint: disable=name-too-long - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # 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_get_authorization_rule_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_authorization_rule_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_keys_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_regenerate_keys_request( - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "authorizationRuleName": _SERIALIZER.url( - "authorization_rule_name", authorization_rule_name, "str", max_length=50, min_length=1 - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_namespace_request( - resource_group_name: str, - namespace_name: str, - subscription_id: str, - *, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int", maximum=1000, minimum=0) - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1) - - # 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( - resource_group_name: str, namespace_name: str, topic_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", "2022-10-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.ServiceBus/namespaces/{namespaceName}/topics/{topicName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, namespace_name: str, topic_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, namespace_name: str, topic_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", "2022-10-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str", max_length=50, min_length=6), - "topicName": _SERIALIZER.url("topic_name", topic_name, "str", min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class TopicsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.servicebus.v2022_10_01_preview.ServiceBusManagementClient`'s - :attr:`topics` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ServiceBusManagementClientConfiguration = ( - 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") - self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") - - @distributed_trace - def list_authorization_rules( - self, resource_group_name: str, namespace_name: str, topic_name: str, **kwargs: Any - ) -> Iterable["_models.SBAuthorizationRule"]: - """Gets authorization rules for a topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720681.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :return: An iterator like instance of either SBAuthorizationRule or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRuleListResult] = 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_authorization_rules_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_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("SBAuthorizationRuleListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: _models.SBAuthorizationRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720678.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720678.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. 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: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: Union[_models.SBAuthorizationRule, IO[bytes]], - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Creates an authorization rule for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720678.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: The shared access authorization rule. Is either a SBAuthorizationRule type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule or - IO[bytes] - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBAuthorizationRule] = 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, "SBAuthorizationRule") - - _request = build_create_or_update_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_authorization_rule( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> _models.SBAuthorizationRule: - """Returns the specified authorization rule. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720676.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: SBAuthorizationRule or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBAuthorizationRule - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBAuthorizationRule] = kwargs.pop("cls", None) - - _request = build_get_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBAuthorizationRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete_authorization_rule( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> None: - """Deletes a topic authorization rule. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720681.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_authorization_rule_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_keys( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - **kwargs: Any - ) -> _models.AccessKeys: - """Gets the primary and secondary connection strings for the topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720677.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.AccessKeys] = kwargs.pop("cls", None) - - _request = build_list_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: _models.RegenerateAccessKeyParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates primary or secondary connection strings for the topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720679.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates primary or secondary connection strings for the topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720679.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. 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: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def regenerate_keys( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - authorization_rule_name: str, - parameters: Union[_models.RegenerateAccessKeyParameters, IO[bytes]], - **kwargs: Any - ) -> _models.AccessKeys: - """Regenerates primary or secondary connection strings for the topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt720679.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param authorization_rule_name: The authorization rule name. Required. - :type authorization_rule_name: str - :param parameters: Parameters supplied to regenerate the authorization rule. Is either a - RegenerateAccessKeyParameters type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.servicebus.v2022_10_01_preview.models.RegenerateAccessKeyParameters or IO[bytes] - :return: AccessKeys or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.AccessKeys - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AccessKeys] = 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, "RegenerateAccessKeyParameters") - - _request = build_regenerate_keys_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_name, - authorization_rule_name=authorization_rule_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AccessKeys", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_namespace( - self, - resource_group_name: str, - namespace_name: str, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.SBTopic"]: - """Gets all the topics in a namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639388.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param skip: Skip is only used if a previous operation returned a partial result. If a previous - response contains a nextLink element, the value of the nextLink element will include a skip - parameter that specifies a starting point to use for subsequent calls. Default value is None. - :type skip: int - :param top: May be used to limit the number of results to the most recent N usageDetails. - Default value is None. - :type top: int - :return: An iterator like instance of either SBTopic or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic] - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBTopicListResult] = 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_namespace_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - skip=skip, - top=top, - 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("SBTopicListResult", 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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - parameters: _models.SBTopic, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBTopic: - """Creates a topic in the specified namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639409.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param parameters: Parameters supplied to create a topic resource. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SBTopic: - """Creates a topic in the specified namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639409.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param parameters: Parameters supplied to create a topic resource. 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: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - namespace_name: str, - topic_name: str, - parameters: Union[_models.SBTopic, IO[bytes]], - **kwargs: Any - ) -> _models.SBTopic: - """Creates a topic in the specified namespace. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639409.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :param parameters: Parameters supplied to create a topic resource. Is either a SBTopic type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic or IO[bytes] - :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :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 "2022-10-01-preview") - ) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SBTopic] = 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, "SBTopic") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBTopic", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, namespace_name: str, topic_name: str, **kwargs: Any - ) -> None: - """Deletes a topic from the specified namespace and resource group. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639404.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :return: None or the result of cls(response) - :rtype: None - :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 "2022-10-01-preview") - ) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, namespace_name: str, topic_name: str, **kwargs: Any) -> _models.SBTopic: - """Returns a description for the specified topic. - - .. seealso:: - - https://msdn.microsoft.com/en-us/library/azure/mt639399.aspx - - :param resource_group_name: Name of the Resource group within the Azure subscription. Required. - :type resource_group_name: str - :param namespace_name: The namespace name. Required. - :type namespace_name: str - :param topic_name: The topic name. Required. - :type topic_name: str - :return: SBTopic or the result of cls(response) - :rtype: ~azure.mgmt.servicebus.v2022_10_01_preview.models.SBTopic - :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 "2022-10-01-preview") - ) - cls: ClsType[_models.SBTopic] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - topic_name=topic_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) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SBTopic", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/py.typed b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2022_10_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_get.py index eba449fd5484..bca58a08187b 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_list_all.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_list_all.py index 78a8a3b2ed58..b6892cbdfa10 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_list_all.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_list_all.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListAll.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListAll.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_list_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_list_key.py index 275b1b06c5f9..473d3a2d942b 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_list_key.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_authorization_rule_list_key.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListKey.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListKey.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_check_name_availability.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_check_name_availability.py index 33898b219502..152e06f659a6 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_check_name_availability.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_check_name_availability.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasCheckNameAvailability.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasCheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_create.py index 66f332a30fac..17eb9909a3f1 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_create.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_delete.py index 0a5662caf691..a37fc9b6610f 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_fail_over.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_fail_over.py index 3eba2f2fb2bc..e8021bb355aa 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_fail_over.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_fail_over.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasFailOver.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasFailOver.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_get.py index 6207177d1bb6..a7a711d2f243 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_list.py index ab3fd2cbdf70..c4450a1b1a99 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_list.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sb_alias_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasList.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBAliasList.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sbeh_alias_break_pairing.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sbeh_alias_break_pairing.py index 4185842009ae..a91f57aaeb53 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sbeh_alias_break_pairing.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/disaster_recovery_configs/sbeh_alias_break_pairing.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBEHAliasBreakPairing.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/disasterRecoveryConfigs/SBEHAliasBreakPairing.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_complete_migration.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_complete_migration.py index f12478b2c294..ce98322dd3da 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_complete_migration.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_complete_migration.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationCompleteMigration.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCompleteMigration.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_create_and_start_migration.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_create_and_start_migration.py index 77a8b1b28dfa..ae945fe7beda 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_create_and_start_migration.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_create_and_start_migration.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_delete.py index 0a3481897a08..5b5850296b1f 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_get.py index 7b37bb185537..639297ac8fc2 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_list.py index ca31d33966f8..f1919e7f55a6 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_list.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationList.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationList.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_revert.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_revert.py index 5f0ffcc2521a..9f8344bafdc7 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_revert.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/migrationconfigurations/sb_migrationconfiguration_revert.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationRevert.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationRevert.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_create.py index f5472441f10f..794ecb15b892 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_create.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_delete.py index 424f348a63e5..17845480c795 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_delete.py @@ -28,7 +28,7 @@ def main(): client = ServiceBusManagementClient( credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", + subscription_id="00000000-0000-0000-0000-000000000000", ) client.private_endpoint_connections.begin_delete( @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_get.py index 340daf3d126d..e54ec502d8bf 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_list.py index 3fe05e3eb645..b07913225656 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_list.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_end_point_connection_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionList.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateEndPointConnectionList.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_link_resources_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_link_resources_get.py index d55da9ca717d..ed3c3e8415f6 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_link_resources_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/private_link_resources_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateLinkResourcesGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/PrivateLinkResourcesGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_create.py index f78f50d36c91..3df17bd61694 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_create.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_delete.py index 7449947d0336..34f18b3c2f13 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_get.py index 282e7f46529d..9abad1560165 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_list_all.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_list_all.py index 2a246fb887c0..8f9638081966 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_list_all.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_list_all.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleListAll.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListAll.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_list_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_list_key.py index 6ab2fe81bd71..b6213aea9a4d 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_list_key.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_list_key.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleListKey.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListKey.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_regenerate_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_regenerate_key.py index 44a7f70d0d69..ac2fc79b6fcf 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_regenerate_key.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_authorization_rule_regenerate_key.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleRegenerateKey.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleRegenerateKey.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_check_name_availability.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_check_name_availability.py index da8edb875abe..7011634a1248 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_check_name_availability.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_check_name_availability.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceCheckNameAvailability.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceCheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_create.py index c722e27d4299..4628aa2c7dca 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_create.py @@ -36,13 +36,14 @@ def main(): namespace_name="sdk-Namespace2924", parameters={ "location": "South Central US", - "sku": {"name": "Standard", "tier": "Standard"}, + "properties": {"premiumMessagingPartitions": 2}, + "sku": {"capacity": 4, "name": "Premium", "tier": "Premium"}, "tags": {"tag1": "value1", "tag2": "value2"}, }, ).result() print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_delete.py index 1d6e32de744f..fc21eb78db32 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_delete.py @@ -28,7 +28,7 @@ def main(): client = ServiceBusManagementClient( credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", + subscription_id="00000000-0000-0000-0000-000000000000", ) client.namespaces.begin_delete( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_get.py index ebb483ccfd78..b7fdb078ef2c 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_list.py index 88aa4dd2f628..ff9e0b0c7f18 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_list.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_list.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceList.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceList.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_list_by_resource_group.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_list_by_resource_group.py index 91cf3dd84d6c..ee8c3fac8503 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_list_by_resource_group.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_list_by_resource_group.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceListByResourceGroup.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_update.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_update.py index a35f7ff79269..5b6cdc425ef9 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_update.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/sb_name_space_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceUpdate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/SBNameSpaceUpdate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_create.py index cc4baffce59a..b86bce47cac8 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_create.py @@ -70,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_get.py index 760201c511ea..18c769bc8cf3 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_list.py index e52f2494c644..6ce00da6f35f 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_list.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/name_spaces/virtual_network_rule/sb_network_rule_set_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetList.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetList.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_create.py deleted file mode 100644 index b20e0882a66e..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_create.py +++ /dev/null @@ -1,51 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python private_end_point_connection_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subID", - ) - - response = client.private_endpoint_connections.create_or_update( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-2924", - private_endpoint_connection_name="privateEndpointConnectionName", - parameters={ - "properties": { - "privateEndpoint": { - "id": "/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-8396/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-2847" - }, - "privateLinkServiceConnectionState": {"description": "testing", "status": "Rejected"}, - "provisioningState": "Succeeded", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_delete.py deleted file mode 100644 index 8429e43d0bc2..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_delete.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python private_end_point_connection_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.private_endpoint_connections.begin_delete( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-3285", - private_endpoint_connection_name="928c44d5-b7c6-423b-b6fa-811e0c27b3e0", - ).result() - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_get.py deleted file mode 100644 index 77bf3584d74b..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_get.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python private_end_point_connection_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subID", - ) - - response = client.private_endpoint_connections.get( - resource_group_name="SDK-ServiceBus-4794", - namespace_name="sdk-Namespace-5828", - private_endpoint_connection_name="privateEndpointConnectionName", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_list.py deleted file mode 100644 index 52955c81bf88..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_end_point_connection_list.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python private_end_point_connection_list.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subID", - ) - - response = client.private_endpoint_connections.list( - resource_group_name="SDK-ServiceBus-4794", - namespace_name="sdk-Namespace-5828", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionList.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_link_resources_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_link_resources_get.py deleted file mode 100644 index 8ff0901e9d81..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/private_link_resources_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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python private_link_resources_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subID", - ) - - response = client.private_link_resources.get( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-2924", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateLinkResourcesGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_create.py index ccabedf4a563..648cd80e6a09 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_delete.py index f37dae4dfd86..9bb918e39c8a 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_delete.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_get.py index a9b09345f308..b99afc5f4c55 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_list_all.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_list_all.py index 37ae0e32916d..4bfa0ae92db9 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_list_all.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_list_all.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleListAll.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleListAll.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_list_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_list_key.py index 8f8a4f2beb99..e6c659dbb526 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_list_key.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_list_key.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleListKey.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleListKey.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_regenerate_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_regenerate_key.py index d5d560d86afd..1015d41bc62a 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_regenerate_key.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_authorization_rule_regenerate_key.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleRegenerateKey.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueAuthorizationRuleRegenerateKey.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_create.py index c2ea7e93ae87..84d5a4ed5dfe 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_create.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_delete.py index 4491704d628f..c29572a29f4b 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_get.py index 881a545f0c69..854d0015e44f 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_list_by_name_space.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_list_by_name_space.py index 7bf2dd27446d..f7ce266ce6aa 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_list_by_name_space.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/queues/sb_queue_list_by_name_space.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueListByNameSpace.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Queues/SBQueueListByNameSpace.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_create_correlation_filter.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_create_correlation_filter.py deleted file mode 100644 index 5b24f0fd2738..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_create_correlation_filter.py +++ /dev/null @@ -1,50 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python rule_create_correlation_filter.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subscriptionId", - ) - - response = client.rules.create_or_update( - resource_group_name="resourceGroupName", - namespace_name="sdk-Namespace-1319", - topic_name="sdk-Topics-2081", - subscription_name="sdk-Subscriptions-8691", - rule_name="sdk-Rules-6571", - parameters={ - "properties": { - "correlationFilter": {"properties": {"topicHint": "Crop"}}, - "filterType": "CorrelationFilter", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate_CorrelationFilter.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_create_sql_filter.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_create_sql_filter.py deleted file mode 100644 index a7a517f9df11..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_create_sql_filter.py +++ /dev/null @@ -1,45 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python rule_create_sql_filter.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subscriptionId", - ) - - response = client.rules.create_or_update( - resource_group_name="resourceGroupName", - namespace_name="sdk-Namespace-1319", - topic_name="sdk-Topics-2081", - subscription_name="sdk-Subscriptions-8691", - rule_name="sdk-Rules-6571", - parameters={"properties": {"filterType": "SqlFilter", "sqlFilter": {"sqlExpression": "myproperty=test"}}}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate_SqlFilter.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_delete.py deleted file mode 100644 index f3bc5c47eb9b..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_delete.py +++ /dev/null @@ -1,44 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python rule_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.rules.delete( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-1319", - topic_name="sdk-Topics-2081", - subscription_name="sdk-Subscriptions-8691", - rule_name="sdk-Rules-6571", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_get.py deleted file mode 100644 index 308777386174..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_get.py +++ /dev/null @@ -1,44 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python rule_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.rules.get( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-1319", - topic_name="sdk-Topics-2081", - subscription_name="sdk-Subscriptions-8691", - rule_name="sdk-Rules-6571", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_list_by_subscription.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_list_by_subscription.py deleted file mode 100644 index d41bb82e14d2..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rule_list_by_subscription.py +++ /dev/null @@ -1,44 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python rule_list_by_subscription.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.rules.list_by_subscriptions( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-1319", - topic_name="sdk-Topics-2081", - subscription_name="sdk-Subscriptions-8691", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_create_correlation_filter.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_create_correlation_filter.py index f39c5f7e5b2a..7afd1e604332 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_create_correlation_filter.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_create_correlation_filter.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate_CorrelationFilter.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleCreate_CorrelationFilter.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_create_sql_filter.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_create_sql_filter.py index de8e61e61d8a..fbed11fe7035 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_create_sql_filter.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_create_sql_filter.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate_SqlFilter.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleCreate_SqlFilter.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_delete.py index 8edc6ad8f126..dd493eb7c4f4 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_delete.py @@ -40,6 +40,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_get.py index 15bb78ce88c1..a60a0ac3b01c 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_list_by_subscription.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_list_by_subscription.py index 6d00fc3cd9fe..39b47f03207e 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_list_by_subscription.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/rules/rule_list_by_subscription.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleListBySubscription.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Rules/RuleListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_get.py deleted file mode 100644 index 30063f039cbd..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_get.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_alias_authorization_rule_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="exampleSubscriptionId", - ) - - response = client.disaster_recovery_configs.get_authorization_rule( - resource_group_name="exampleResourceGroup", - namespace_name="sdk-Namespace-9080", - alias="sdk-DisasterRecovery-4879", - authorization_rule_name="sdk-Authrules-4879", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_list_all.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_list_all.py deleted file mode 100644 index 955fd0d97fce..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_list_all.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_alias_authorization_rule_list_all.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="exampleSubscriptionId", - ) - - response = client.disaster_recovery_configs.list_authorization_rules( - resource_group_name="exampleResourceGroup", - namespace_name="sdk-Namespace-9080", - alias="sdk-DisasterRecovery-4047", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListAll.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_list_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_list_key.py deleted file mode 100644 index 86f8ac4483d7..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_authorization_rule_list_key.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_alias_authorization_rule_list_key.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="exampleSubscriptionId", - ) - - response = client.disaster_recovery_configs.list_keys( - resource_group_name="exampleResourceGroup", - namespace_name="sdk-Namespace-2702", - alias="sdk-DisasterRecovery-4047", - authorization_rule_name="sdk-Authrules-1746", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListKey.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_check_name_availability.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_check_name_availability.py deleted file mode 100644 index 29f275abb093..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_check_name_availability.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_alias_check_name_availability.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="exampleSubscriptionId", - ) - - response = client.disaster_recovery_configs.check_name_availability( - resource_group_name="exampleResourceGroup", - namespace_name="sdk-Namespace-9080", - parameters={"name": "sdk-DisasterRecovery-9474"}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasCheckNameAvailability.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_create.py deleted file mode 100644 index eede415f8ba8..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_create.py +++ /dev/null @@ -1,45 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_alias_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.disaster_recovery_configs.create_or_update( - resource_group_name="ardsouzatestRG", - namespace_name="sdk-Namespace-8860", - alias="sdk-Namespace-8860", - parameters={ - "properties": {"alternateName": "alternameforAlias-Namespace-8860", "partnerNamespace": "sdk-Namespace-37"} - }, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_delete.py deleted file mode 100644 index 1ebca90e4db9..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_delete.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_alias_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.disaster_recovery_configs.delete( - resource_group_name="SouthCentralUS", - namespace_name="sdk-Namespace-8860", - alias="sdk-DisasterRecovery-3814", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_fail_over.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_fail_over.py deleted file mode 100644 index feb1086aa8c4..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_fail_over.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_alias_fail_over.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.disaster_recovery_configs.fail_over( - resource_group_name="ardsouzatestRG", - namespace_name="sdk-Namespace-8860", - alias="sdk-DisasterRecovery-3814", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasFailOver.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_get.py deleted file mode 100644 index 2ce1fbe64f2e..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_get.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_alias_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.disaster_recovery_configs.get( - resource_group_name="ardsouzatestRG", - namespace_name="sdk-Namespace-8860", - alias="sdk-DisasterRecovery-3814", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_list.py deleted file mode 100644 index d2c17fd286ef..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_alias_list.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_alias_list.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.disaster_recovery_configs.list( - resource_group_name="ardsouzatestRG", - namespace_name="sdk-Namespace-8860", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasList.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_complete_migration.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_complete_migration.py deleted file mode 100644 index 7a429b82386e..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_complete_migration.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_migrationconfiguration_complete_migration.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SubscriptionId", - ) - - response = client.migration_configs.complete_migration( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-41", - config_name="$default", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationCompleteMigration.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_create_and_start_migration.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_create_and_start_migration.py deleted file mode 100644 index 43c50982646a..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_create_and_start_migration.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_migrationconfiguration_create_and_start_migration.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SubscriptionId", - ) - - response = client.migration_configs.begin_create_and_start_migration( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-41", - config_name="$default", - parameters={ - "properties": { - "postMigrationName": "sdk-PostMigration-5919", - "targetNamespace": "/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-4028", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_delete.py deleted file mode 100644 index 38a2bf91bc15..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_delete.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_migrationconfiguration_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SubscriptionId", - ) - - response = client.migration_configs.delete( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-41", - config_name="$default", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_get.py deleted file mode 100644 index 4f192da17513..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_get.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_migrationconfiguration_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SubscriptionId", - ) - - response = client.migration_configs.get( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-41", - config_name="$default", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_list.py deleted file mode 100644 index 487ead2e4f1d..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_list.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_migrationconfiguration_list.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SubscriptionId", - ) - - response = client.migration_configs.list( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-9259", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationList.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_revert.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_revert.py deleted file mode 100644 index 7dec86929978..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_migrationconfiguration_revert.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_migrationconfiguration_revert.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SubscriptionId", - ) - - response = client.migration_configs.revert( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-41", - config_name="$default", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationRevert.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_create.py deleted file mode 100644 index c5a61d19212b..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_create.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_authorization_rule_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.create_or_update_authorization_rule( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-6914", - authorization_rule_name="sdk-AuthRules-1788", - parameters={"properties": {"rights": ["Listen", "Send"]}}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_delete.py deleted file mode 100644 index 09b8ec4d1d7d..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_delete.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_authorization_rule_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.delete_authorization_rule( - resource_group_name="ArunMonocle", - namespace_name="sdk-namespace-6914", - authorization_rule_name="sdk-AuthRules-1788", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_get.py deleted file mode 100644 index 3c713fb3f4c1..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_get.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_authorization_rule_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.get_authorization_rule( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-6914", - authorization_rule_name="sdk-AuthRules-1788", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_list_all.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_list_all.py deleted file mode 100644 index 2891f2b9f035..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_list_all.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_authorization_rule_list_all.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.list_authorization_rules( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-6914", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleListAll.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_list_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_list_key.py deleted file mode 100644 index 714c2942a65c..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_list_key.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_authorization_rule_list_key.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.list_keys( - resource_group_name="ArunMonocle", - namespace_name="sdk-namespace-6914", - authorization_rule_name="sdk-AuthRules-1788", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleListKey.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_regenerate_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_regenerate_key.py deleted file mode 100644 index c5ac0e528291..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_authorization_rule_regenerate_key.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_authorization_rule_regenerate_key.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.regenerate_keys( - resource_group_name="ArunMonocle", - namespace_name="sdk-namespace-6914", - authorization_rule_name="sdk-AuthRules-1788", - parameters={"keyType": "PrimaryKey"}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleRegenerateKey.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_check_name_availability.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_check_name_availability.py deleted file mode 100644 index cfd4da4ad12c..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_check_name_availability.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_check_name_availability.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.check_name_availability( - parameters={"name": "sdk-Namespace-2924"}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceCheckNameAvailability.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_create.py deleted file mode 100644 index f50459177a79..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_create.py +++ /dev/null @@ -1,46 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.begin_create_or_update( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace2924", - parameters={ - "location": "South Central US", - "sku": {"name": "Standard", "tier": "Standard"}, - "tags": {"tag1": "value1", "tag2": "value2"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_delete.py deleted file mode 100644 index d4c3b933ab75..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_delete.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.begin_delete( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-3285", - ).result() - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_get.py deleted file mode 100644 index 33fd6fcb183c..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.get( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-2924", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_list.py deleted file mode 100644 index 8cbb0cfd02fc..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_list.py +++ /dev/null @@ -1,39 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_list.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceList.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_list_by_resource_group.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_list_by_resource_group.py deleted file mode 100644 index 63a57b4a6903..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_list_by_resource_group.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_list_by_resource_group.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.list_by_resource_group( - resource_group_name="ArunMonocle", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_update.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_update.py deleted file mode 100644 index 27012d9f33f3..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_name_space_update.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_name_space_update.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.namespaces.update( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-3285", - parameters={"location": "South Central US", "tags": {"tag3": "value3", "tag4": "value4"}}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_create.py deleted file mode 100644 index 5a6121a269eb..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_create.py +++ /dev/null @@ -1,73 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_network_rule_set_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="Subscription", - ) - - response = client.namespaces.create_or_update_network_rule_set( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-6019", - parameters={ - "properties": { - "defaultAction": "Deny", - "ipRules": [ - {"action": "Allow", "ipMask": "1.1.1.1"}, - {"action": "Allow", "ipMask": "1.1.1.2"}, - {"action": "Allow", "ipMask": "1.1.1.3"}, - {"action": "Allow", "ipMask": "1.1.1.4"}, - {"action": "Allow", "ipMask": "1.1.1.5"}, - ], - "virtualNetworkRules": [ - { - "ignoreMissingVnetServiceEndpoint": True, - "subnet": { - "id": "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2" - }, - }, - { - "ignoreMissingVnetServiceEndpoint": False, - "subnet": { - "id": "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3" - }, - }, - { - "ignoreMissingVnetServiceEndpoint": False, - "subnet": { - "id": "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6" - }, - }, - ], - } - }, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_get.py deleted file mode 100644 index 695b73572b29..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_network_rule_set_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="Subscription", - ) - - response = client.namespaces.get_network_rule_set( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-6019", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_list.py deleted file mode 100644 index ea110b8800c7..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_network_rule_set_list.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_network_rule_set_list.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="Subscription", - ) - - response = client.namespaces.list_network_rule_sets( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-6019", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetList.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_operations_list.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_operations_list.py index d313c4ba8867..8b533771c92d 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_operations_list.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_operations_list.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/SBOperations_List.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/SBOperations_List.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_create.py deleted file mode 100644 index 261595ba8f7e..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_create.py +++ /dev/null @@ -1,44 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_authorization_rule_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.create_or_update_authorization_rule( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-7982", - queue_name="sdk-Queues-2317", - authorization_rule_name="sdk-AuthRules-5800", - parameters={"properties": {"rights": ["Listen", "Send"]}}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_delete.py deleted file mode 100644 index 926892adce78..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_delete.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_authorization_rule_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.delete_authorization_rule( - resource_group_name="ArunMonocle", - namespace_name="sdk-namespace-7982", - queue_name="sdk-Queues-2317", - authorization_rule_name="sdk-AuthRules-5800", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_get.py deleted file mode 100644 index 55d0437579be..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_get.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_authorization_rule_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.get_authorization_rule( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-7982", - queue_name="sdk-Queues-2317", - authorization_rule_name="sdk-AuthRules-5800", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_list_all.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_list_all.py deleted file mode 100644 index 53c93dbd3acf..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_list_all.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_authorization_rule_list_all.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.list_authorization_rules( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-7982", - queue_name="sdk-Queues-2317", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleListAll.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_list_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_list_key.py deleted file mode 100644 index 0f12a31f3775..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_list_key.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_authorization_rule_list_key.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.list_keys( - resource_group_name="ArunMonocle", - namespace_name="sdk-namespace-7982", - queue_name="sdk-Queues-2317", - authorization_rule_name="sdk-AuthRules-5800", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleListKey.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_regenerate_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_regenerate_key.py deleted file mode 100644 index 925fb902ad9f..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_authorization_rule_regenerate_key.py +++ /dev/null @@ -1,44 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_authorization_rule_regenerate_key.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.regenerate_keys( - resource_group_name="ArunMonocle", - namespace_name="sdk-namespace-7982", - queue_name="sdk-Queues-2317", - authorization_rule_name="sdk-AuthRules-5800", - parameters={"keyType": "PrimaryKey"}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleRegenerateKey.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_create.py deleted file mode 100644 index 4e8cab3f0031..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_create.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.create_or_update( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-3174", - queue_name="sdk-Queues-5647", - parameters={"properties": {"enablePartitioning": True}}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_delete.py deleted file mode 100644 index b6b6cc27c448..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_delete.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.delete( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-183", - queue_name="sdk-Queues-8708", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_get.py deleted file mode 100644 index 80305861c9ca..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_get.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.get( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-3174", - queue_name="sdk-Queues-5647", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_list_by_name_space.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_list_by_name_space.py deleted file mode 100644 index 7b60f279dec4..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_queue_list_by_name_space.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_queue_list_by_name_space.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.queues.list_by_namespace( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-3174", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueListByNameSpace.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_create.py deleted file mode 100644 index efbe5a6e19a4..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_create.py +++ /dev/null @@ -1,44 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_subscription_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="Subscriptionid", - ) - - response = client.subscriptions.create_or_update( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-1349", - topic_name="sdk-Topics-8740", - subscription_name="sdk-Subscriptions-2178", - parameters={"properties": {"enableBatchedOperations": True}}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_delete.py deleted file mode 100644 index aff798a100a4..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_delete.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_subscription_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subscriptionId", - ) - - response = client.subscriptions.delete( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-5882", - topic_name="sdk-Topics-1804", - subscription_name="sdk-Subscriptions-3670", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_get.py deleted file mode 100644 index 5b757a870900..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_get.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_subscription_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="Subscriptionid", - ) - - response = client.subscriptions.get( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-1349", - topic_name="sdk-Topics-8740", - subscription_name="sdk-Subscriptions-2178", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_list_by_topic.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_list_by_topic.py deleted file mode 100644 index 24671e78ace8..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_subscription_list_by_topic.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_subscription_list_by_topic.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5{Subscriptionid}", - ) - - response = client.subscriptions.list_by_topic( - resource_group_name="ResourceGroup", - namespace_name="sdk-Namespace-1349", - topic_name="sdk-Topics-8740", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionListByTopic.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_create.py deleted file mode 100644 index e582bafdc0d1..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_create.py +++ /dev/null @@ -1,44 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_authorization_rule_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.topics.create_or_update_authorization_rule( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-6261", - topic_name="sdk-Topics-1984", - authorization_rule_name="sdk-AuthRules-4310", - parameters={"properties": {"rights": ["Listen", "Send"]}}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_delete.py deleted file mode 100644 index 7bcedb72deb7..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_delete.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_authorization_rule_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.topics.delete_authorization_rule( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-6261", - topic_name="sdk-Topics-1984", - authorization_rule_name="sdk-AuthRules-4310", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_get.py deleted file mode 100644 index ac9d9795d619..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_get.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_authorization_rule_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.topics.get_authorization_rule( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-6261", - topic_name="sdk-Topics-1984", - authorization_rule_name="sdk-AuthRules-4310", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_list_all.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_list_all.py deleted file mode 100644 index 041eaa46ec15..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_list_all.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_authorization_rule_list_all.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.topics.list_authorization_rules( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-6261", - topic_name="sdk-Topics-1984", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleListAll.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_list_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_list_key.py deleted file mode 100644 index d8de9c93e92f..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_list_key.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_authorization_rule_list_key.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="e2f361f0-3b27-4503-a9cc-21cfba380093", - ) - - response = client.topics.list_keys( - resource_group_name="Default-ServiceBus-WestUS", - namespace_name="sdk-Namespace8408", - topic_name="sdk-Topics2075", - authorization_rule_name="sdk-Authrules5067", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleListKey.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_regenerate_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_regenerate_key.py deleted file mode 100644 index 70c28a861670..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_authorization_rule_regenerate_key.py +++ /dev/null @@ -1,44 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_authorization_rule_regenerate_key.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="e2f361f0-3b27-4503-a9cc-21cfba380093", - ) - - response = client.topics.regenerate_keys( - resource_group_name="Default-ServiceBus-WestUS", - namespace_name="sdk-Namespace8408", - topic_name="sdk-Topics2075", - authorization_rule_name="sdk-Authrules5067", - parameters={"keyType": "PrimaryKey"}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleRegenerateKey.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_create.py deleted file mode 100644 index c90dc8a6f2c7..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_create.py +++ /dev/null @@ -1,43 +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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_create.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.topics.create_or_update( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-1617", - topic_name="sdk-Topics-5488", - parameters={"properties": {"enableExpress": True}}, - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_delete.py deleted file mode 100644 index 669841fc21c1..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_delete.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_delete.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.topics.delete( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-1617", - topic_name="sdk-Topics-5488", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_get.py deleted file mode 100644 index 6808a263214d..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_get.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.topics.get( - resource_group_name="ArunMonocle", - namespace_name="sdk-Namespace-1617", - topic_name="sdk-Topics-5488", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicGet.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_list_by_name_space.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_list_by_name_space.py deleted file mode 100644 index bcd820e448bb..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sb_topic_list_by_name_space.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sb_topic_list_by_name_space.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.topics.list_by_namespace( - resource_group_name="Default-ServiceBus-WestUS", - namespace_name="sdk-Namespace-1617", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicListByNameSpace.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sbeh_alias_break_pairing.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sbeh_alias_break_pairing.py deleted file mode 100644 index 95adcd7d9b31..000000000000 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/sbeh_alias_break_pairing.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.servicebus import ServiceBusManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-servicebus -# USAGE - python sbeh_alias_break_pairing.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 = ServiceBusManagementClient( - credential=DefaultAzureCredential(), - subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4", - ) - - response = client.disaster_recovery_configs.break_pairing( - resource_group_name="ardsouzatestRG", - namespace_name="sdk-Namespace-8860", - alias="sdk-DisasterRecovery-3814", - ) - print(response) - - -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBEHAliasBreakPairing.json -if __name__ == "__main__": - main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_create.py index a27bbc6d5554..e1dab5c8a891 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_delete.py index 8692181af787..bc58afc26f07 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_delete.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_get.py index 56d4f03595f9..ed6fe95ab274 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_list_by_topic.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_list_by_topic.py index f5d8856d4103..fe90798d7c6d 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_list_by_topic.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/subscriptions/sb_subscription_list_by_topic.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionListByTopic.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Subscriptions/SBSubscriptionListByTopic.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_create.py index a2001b270478..72e5c6bb992c 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_delete.py index 1d69697ed541..b2e84d52b007 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_delete.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_get.py index 2cfa6867ffbf..7518bd6b2e9c 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_list_all.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_list_all.py index 762f3825a67b..f5f0b2e84efe 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_list_all.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_list_all.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleListAll.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleListAll.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_list_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_list_key.py index d106475c1f4a..e17402353331 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_list_key.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_list_key.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleListKey.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleListKey.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_regenerate_key.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_regenerate_key.py index 72711b7f9bdb..b3172fbaf7f9 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_regenerate_key.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_authorization_rule_regenerate_key.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleRegenerateKey.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicAuthorizationRuleRegenerateKey.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_create.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_create.py index 77863f718f8b..2e7179c4f558 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_create.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_create.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicCreate.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicCreate.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_delete.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_delete.py index 9ea0d9bc0685..ea9333b21608 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_delete.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicDelete.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicDelete.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_get.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_get.py index ffefbfe280fa..21343fa38af2 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_get.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicGet.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicGet.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_list_by_name_space.py b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_list_by_name_space.py index 478e9be589b9..511564a7d757 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_list_by_name_space.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_samples/topics/sb_topic_list_by_name_space.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicListByNameSpace.json +# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/examples/Topics/SBTopicListByNameSpace.json if __name__ == "__main__": main() diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_disaster_recovery_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_disaster_recovery_configs_operations.py index 9a6598beb8aa..addd8ed93f7a 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_disaster_recovery_configs_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_disaster_recovery_configs_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -24,7 +24,7 @@ def test_disaster_recovery_configs_list(self, resource_group): response = self.client.disaster_recovery_configs.list( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -56,7 +56,7 @@ def test_disaster_recovery_configs_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ def test_disaster_recovery_configs_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -82,7 +82,7 @@ def test_disaster_recovery_configs_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -95,7 +95,7 @@ def test_disaster_recovery_configs_break_pairing(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -108,7 +108,7 @@ def test_disaster_recovery_configs_fail_over(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -121,7 +121,7 @@ def test_disaster_recovery_configs_list_authorization_rules(self, resource_group resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -135,7 +135,7 @@ def test_disaster_recovery_configs_get_authorization_rule(self, resource_group): namespace_name="str", alias="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -149,7 +149,7 @@ def test_disaster_recovery_configs_list_keys(self, resource_group): namespace_name="str", alias="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -162,7 +162,7 @@ def test_disaster_recovery_configs_check_name_availability(self, resource_group) resource_group_name=resource_group.name, namespace_name="str", parameters={"name": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_disaster_recovery_configs_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_disaster_recovery_configs_operations_async.py index 85adb0177c88..2cf29a11987f 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_disaster_recovery_configs_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_disaster_recovery_configs_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -25,7 +25,7 @@ async def test_disaster_recovery_configs_list(self, resource_group): response = self.client.disaster_recovery_configs.list( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -57,7 +57,7 @@ async def test_disaster_recovery_configs_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ async def test_disaster_recovery_configs_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -83,7 +83,7 @@ async def test_disaster_recovery_configs_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -96,7 +96,7 @@ async def test_disaster_recovery_configs_break_pairing(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -109,7 +109,7 @@ async def test_disaster_recovery_configs_fail_over(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -122,7 +122,7 @@ async def test_disaster_recovery_configs_list_authorization_rules(self, resource resource_group_name=resource_group.name, namespace_name="str", alias="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -136,7 +136,7 @@ async def test_disaster_recovery_configs_get_authorization_rule(self, resource_g namespace_name="str", alias="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -150,7 +150,7 @@ async def test_disaster_recovery_configs_list_keys(self, resource_group): namespace_name="str", alias="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -163,7 +163,7 @@ async def test_disaster_recovery_configs_check_name_availability(self, resource_ resource_group_name=resource_group.name, namespace_name="str", parameters={"name": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_migration_configs_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_migration_configs_operations.py index a8b710b814f7..0b0858a327a0 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_migration_configs_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_migration_configs_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -24,7 +24,7 @@ def test_migration_configs_list(self, resource_group): response = self.client.migration_configs.list( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -56,7 +56,7 @@ def test_migration_configs_begin_create_and_start_migration(self, resource_group "targetNamespace": "str", "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -69,7 +69,7 @@ def test_migration_configs_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", config_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -82,7 +82,7 @@ def test_migration_configs_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", config_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -95,7 +95,7 @@ def test_migration_configs_complete_migration(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", config_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -108,7 +108,7 @@ def test_migration_configs_revert(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", config_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_migration_configs_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_migration_configs_operations_async.py index 0b9820051bf3..b9d2f860f3dd 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_migration_configs_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_migration_configs_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -25,7 +25,7 @@ async def test_migration_configs_list(self, resource_group): response = self.client.migration_configs.list( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -58,7 +58,7 @@ async def test_migration_configs_begin_create_and_start_migration(self, resource "targetNamespace": "str", "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -72,7 +72,7 @@ async def test_migration_configs_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", config_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -85,7 +85,7 @@ async def test_migration_configs_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", config_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -98,7 +98,7 @@ async def test_migration_configs_complete_migration(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", config_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -111,7 +111,7 @@ async def test_migration_configs_revert(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", config_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_namespaces_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_namespaces_operations.py index e5d44a0b936e..b94eb3cd8de3 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_namespaces_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_namespaces_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_namespaces_list(self, resource_group): response = self.client.namespaces.list( - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_namespaces_list(self, resource_group): def test_namespaces_list_by_resource_group(self, resource_group): response = self.client.namespaces.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -70,7 +70,9 @@ def test_namespaces_begin_create_or_update(self, resource_group): "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, "metricId": "str", + "minimumTlsVersion": "str", "name": "str", + "premiumMessagingPartitions": 0, "privateEndpointConnections": [ { "id": "str", @@ -91,6 +93,7 @@ def test_namespaces_begin_create_or_update(self, resource_group): } ], "provisioningState": "str", + "publicNetworkAccess": "Enabled", "serviceBusEndpoint": "str", "sku": {"name": "str", "capacity": 0, "tier": "str"}, "status": "str", @@ -107,7 +110,7 @@ def test_namespaces_begin_create_or_update(self, resource_group): "updatedAt": "2020-02-20 00:00:00", "zoneRedundant": bool, }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -119,7 +122,7 @@ def test_namespaces_begin_delete(self, resource_group): response = self.client.namespaces.begin_delete( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -131,7 +134,7 @@ def test_namespaces_get(self, resource_group): response = self.client.namespaces.get( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -196,7 +199,7 @@ def test_namespaces_update(self, resource_group): "type": "str", "updatedAt": "2020-02-20 00:00:00", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -227,7 +230,7 @@ def test_namespaces_create_or_update_network_rule_set(self, resource_group): "type": "str", "virtualNetworkRules": [{"ignoreMissingVnetServiceEndpoint": bool, "subnet": {"id": "str"}}], }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -239,7 +242,7 @@ def test_namespaces_get_network_rule_set(self, resource_group): response = self.client.namespaces.get_network_rule_set( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -251,7 +254,7 @@ def test_namespaces_list_network_rule_sets(self, resource_group): response = self.client.namespaces.list_network_rule_sets( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -263,7 +266,7 @@ def test_namespaces_list_authorization_rules(self, resource_group): response = self.client.namespaces.list_authorization_rules( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -291,7 +294,7 @@ def test_namespaces_create_or_update_authorization_rule(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -304,7 +307,7 @@ def test_namespaces_delete_authorization_rule(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -317,7 +320,7 @@ def test_namespaces_get_authorization_rule(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -330,7 +333,7 @@ def test_namespaces_list_keys(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -344,7 +347,7 @@ def test_namespaces_regenerate_keys(self, resource_group): namespace_name="str", authorization_rule_name="str", parameters={"keyType": "str", "key": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -355,7 +358,7 @@ def test_namespaces_regenerate_keys(self, resource_group): def test_namespaces_check_name_availability(self, resource_group): response = self.client.namespaces.check_name_availability( parameters={"name": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_namespaces_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_namespaces_operations_async.py index c7a22e2c1876..17243e222321 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_namespaces_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_namespaces_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_namespaces_list(self, resource_group): response = self.client.namespaces.list( - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_namespaces_list(self, resource_group): async def test_namespaces_list_by_resource_group(self, resource_group): response = self.client.namespaces.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -72,7 +72,9 @@ async def test_namespaces_begin_create_or_update(self, resource_group): "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, "metricId": "str", + "minimumTlsVersion": "str", "name": "str", + "premiumMessagingPartitions": 0, "privateEndpointConnections": [ { "id": "str", @@ -93,6 +95,7 @@ async def test_namespaces_begin_create_or_update(self, resource_group): } ], "provisioningState": "str", + "publicNetworkAccess": "Enabled", "serviceBusEndpoint": "str", "sku": {"name": "str", "capacity": 0, "tier": "str"}, "status": "str", @@ -109,7 +112,7 @@ async def test_namespaces_begin_create_or_update(self, resource_group): "updatedAt": "2020-02-20 00:00:00", "zoneRedundant": bool, }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -123,7 +126,7 @@ async def test_namespaces_begin_delete(self, resource_group): await self.client.namespaces.begin_delete( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -136,7 +139,7 @@ async def test_namespaces_get(self, resource_group): response = await self.client.namespaces.get( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -201,7 +204,7 @@ async def test_namespaces_update(self, resource_group): "type": "str", "updatedAt": "2020-02-20 00:00:00", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -232,7 +235,7 @@ async def test_namespaces_create_or_update_network_rule_set(self, resource_group "type": "str", "virtualNetworkRules": [{"ignoreMissingVnetServiceEndpoint": bool, "subnet": {"id": "str"}}], }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -244,7 +247,7 @@ async def test_namespaces_get_network_rule_set(self, resource_group): response = await self.client.namespaces.get_network_rule_set( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -256,7 +259,7 @@ async def test_namespaces_list_network_rule_sets(self, resource_group): response = self.client.namespaces.list_network_rule_sets( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -268,7 +271,7 @@ async def test_namespaces_list_authorization_rules(self, resource_group): response = self.client.namespaces.list_authorization_rules( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -296,7 +299,7 @@ async def test_namespaces_create_or_update_authorization_rule(self, resource_gro }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -309,7 +312,7 @@ async def test_namespaces_delete_authorization_rule(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -322,7 +325,7 @@ async def test_namespaces_get_authorization_rule(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -335,7 +338,7 @@ async def test_namespaces_list_keys(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -349,7 +352,7 @@ async def test_namespaces_regenerate_keys(self, resource_group): namespace_name="str", authorization_rule_name="str", parameters={"keyType": "str", "key": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -360,7 +363,7 @@ async def test_namespaces_regenerate_keys(self, resource_group): async def test_namespaces_check_name_availability(self, resource_group): response = await self.client.namespaces.check_name_availability( parameters={"name": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_operations.py index 9979e862e739..ef65e5c3c67c 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -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="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_operations_async.py index 0bbdd4fe56d6..11e70096bfbd 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -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="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_endpoint_connections_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_endpoint_connections_operations.py index 18c20489579f..a756666a4f13 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_endpoint_connections_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_endpoint_connections_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -24,7 +24,7 @@ def test_private_endpoint_connections_list(self, resource_group): response = self.client.private_endpoint_connections.list( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -54,7 +54,7 @@ def test_private_endpoint_connections_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -67,7 +67,7 @@ def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", private_endpoint_connection_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -80,7 +80,7 @@ def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", private_endpoint_connection_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_endpoint_connections_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_endpoint_connections_operations_async.py index 32226662a53c..57aeb9bf220a 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_endpoint_connections_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_endpoint_connections_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -25,7 +25,7 @@ async def test_private_endpoint_connections_list(self, resource_group): response = self.client.private_endpoint_connections.list( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -55,7 +55,7 @@ async def test_private_endpoint_connections_create_or_update(self, resource_grou }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ async def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", private_endpoint_connection_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -83,7 +83,7 @@ async def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", private_endpoint_connection_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_link_resources_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_link_resources_operations.py index aaa133f5e55a..6bee9820ba66 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_link_resources_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_link_resources_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -24,7 +24,7 @@ def test_private_link_resources_get(self, resource_group): response = self.client.private_link_resources.get( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_link_resources_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_link_resources_operations_async.py index 1ca5624b1b12..247fabe70fa6 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_link_resources_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_private_link_resources_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -25,7 +25,7 @@ async def test_private_link_resources_get(self, resource_group): response = await self.client.private_link_resources.get( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_queues_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_queues_operations.py index 17a659cd942c..fa6394507a67 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_queues_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_queues_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -25,7 +25,7 @@ def test_queues_list_authorization_rules(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", queue_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -54,7 +54,7 @@ def test_queues_create_or_update_authorization_rule(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ def test_queues_delete_authorization_rule(self, resource_group): namespace_name="str", queue_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -82,7 +82,7 @@ def test_queues_get_authorization_rule(self, resource_group): namespace_name="str", queue_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -96,7 +96,7 @@ def test_queues_list_keys(self, resource_group): namespace_name="str", queue_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -111,7 +111,7 @@ def test_queues_regenerate_keys(self, resource_group): queue_name="str", authorization_rule_name="str", parameters={"keyType": "str", "key": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -123,7 +123,7 @@ def test_queues_list_by_namespace(self, resource_group): response = self.client.queues.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -178,7 +178,7 @@ def test_queues_create_or_update(self, resource_group): "type": "str", "updatedAt": "2020-02-20 00:00:00", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -191,7 +191,7 @@ def test_queues_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", queue_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -204,7 +204,7 @@ def test_queues_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", queue_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_queues_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_queues_operations_async.py index c47a7e60818c..beee1a5a6cd8 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_queues_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_queues_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -26,7 +26,7 @@ async def test_queues_list_authorization_rules(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", queue_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -55,7 +55,7 @@ async def test_queues_create_or_update_authorization_rule(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ async def test_queues_delete_authorization_rule(self, resource_group): namespace_name="str", queue_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -83,7 +83,7 @@ async def test_queues_get_authorization_rule(self, resource_group): namespace_name="str", queue_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -97,7 +97,7 @@ async def test_queues_list_keys(self, resource_group): namespace_name="str", queue_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -112,7 +112,7 @@ async def test_queues_regenerate_keys(self, resource_group): queue_name="str", authorization_rule_name="str", parameters={"keyType": "str", "key": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -124,7 +124,7 @@ async def test_queues_list_by_namespace(self, resource_group): response = self.client.queues.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -179,7 +179,7 @@ async def test_queues_create_or_update(self, resource_group): "type": "str", "updatedAt": "2020-02-20 00:00:00", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -192,7 +192,7 @@ async def test_queues_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", queue_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -205,7 +205,7 @@ async def test_queues_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", queue_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_rules_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_rules_operations.py index 3adbe144734e..c3543868e36e 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_rules_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_rules_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -26,7 +26,7 @@ def test_rules_list_by_subscriptions(self, resource_group): namespace_name="str", topic_name="str", subscription_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -70,7 +70,7 @@ def test_rules_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -85,7 +85,7 @@ def test_rules_delete(self, resource_group): topic_name="str", subscription_name="str", rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -100,7 +100,7 @@ def test_rules_get(self, resource_group): topic_name="str", subscription_name="str", rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_rules_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_rules_operations_async.py index 84476d76f88c..31f1b73cb7d9 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_rules_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_rules_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -27,7 +27,7 @@ async def test_rules_list_by_subscriptions(self, resource_group): namespace_name="str", topic_name="str", subscription_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -71,7 +71,7 @@ async def test_rules_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -86,7 +86,7 @@ async def test_rules_delete(self, resource_group): topic_name="str", subscription_name="str", rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -101,7 +101,7 @@ async def test_rules_get(self, resource_group): topic_name="str", subscription_name="str", rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_subscriptions_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_subscriptions_operations.py index 09ed3ec8a3d1..bd63ce5b07a5 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_subscriptions_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_subscriptions_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -25,7 +25,7 @@ def test_subscriptions_list_by_topic(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", topic_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -78,7 +78,7 @@ def test_subscriptions_create_or_update(self, resource_group): "type": "str", "updatedAt": "2020-02-20 00:00:00", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -92,7 +92,7 @@ def test_subscriptions_delete(self, resource_group): namespace_name="str", topic_name="str", subscription_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -106,7 +106,7 @@ def test_subscriptions_get(self, resource_group): namespace_name="str", topic_name="str", subscription_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_subscriptions_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_subscriptions_operations_async.py index ba4459c890ff..044db727e608 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_subscriptions_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_subscriptions_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -26,7 +26,7 @@ async def test_subscriptions_list_by_topic(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", topic_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -79,7 +79,7 @@ async def test_subscriptions_create_or_update(self, resource_group): "type": "str", "updatedAt": "2020-02-20 00:00:00", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -93,7 +93,7 @@ async def test_subscriptions_delete(self, resource_group): namespace_name="str", topic_name="str", subscription_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -107,7 +107,7 @@ async def test_subscriptions_get(self, resource_group): namespace_name="str", topic_name="str", subscription_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_topics_operations.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_topics_operations.py index 95c6e6d8a804..e565b372fc79 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_topics_operations.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_topics_operations.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01 import ServiceBusManagementClient +from azure.mgmt.servicebus import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -25,7 +25,7 @@ def test_topics_list_authorization_rules(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", topic_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -54,7 +54,7 @@ def test_topics_create_or_update_authorization_rule(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ def test_topics_get_authorization_rule(self, resource_group): namespace_name="str", topic_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -82,7 +82,7 @@ def test_topics_delete_authorization_rule(self, resource_group): namespace_name="str", topic_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -96,7 +96,7 @@ def test_topics_list_keys(self, resource_group): namespace_name="str", topic_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -111,7 +111,7 @@ def test_topics_regenerate_keys(self, resource_group): topic_name="str", authorization_rule_name="str", parameters={"keyType": "str", "key": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -123,7 +123,7 @@ def test_topics_list_by_namespace(self, resource_group): response = self.client.topics.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -173,7 +173,7 @@ def test_topics_create_or_update(self, resource_group): "type": "str", "updatedAt": "2020-02-20 00:00:00", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -186,7 +186,7 @@ def test_topics_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", topic_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -199,7 +199,7 @@ def test_topics_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", topic_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_topics_operations_async.py b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_topics_operations_async.py index 98cf2745316a..713f26acebfb 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_topics_operations_async.py +++ b/sdk/servicebus/azure-mgmt-servicebus/generated_tests/test_service_bus_management_topics_operations_async.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.servicebus.v2021_11_01.aio import ServiceBusManagementClient +from azure.mgmt.servicebus.aio import ServiceBusManagementClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -26,7 +26,7 @@ async def test_topics_list_authorization_rules(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", topic_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -55,7 +55,7 @@ async def test_topics_create_or_update_authorization_rule(self, resource_group): }, "type": "str", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ async def test_topics_get_authorization_rule(self, resource_group): namespace_name="str", topic_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -83,7 +83,7 @@ async def test_topics_delete_authorization_rule(self, resource_group): namespace_name="str", topic_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -97,7 +97,7 @@ async def test_topics_list_keys(self, resource_group): namespace_name="str", topic_name="str", authorization_rule_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -112,7 +112,7 @@ async def test_topics_regenerate_keys(self, resource_group): topic_name="str", authorization_rule_name="str", parameters={"keyType": "str", "key": "str"}, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -124,7 +124,7 @@ async def test_topics_list_by_namespace(self, resource_group): response = self.client.topics.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -174,7 +174,7 @@ async def test_topics_create_or_update(self, resource_group): "type": "str", "updatedAt": "2020-02-20 00:00:00", }, - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -187,7 +187,7 @@ async def test_topics_delete(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", topic_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself @@ -200,7 +200,7 @@ async def test_topics_get(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", topic_name="str", - api_version="2021-11-01", + api_version="2022-10-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/servicebus/azure-mgmt-servicebus/sdk_packaging.toml b/sdk/servicebus/azure-mgmt-servicebus/sdk_packaging.toml index 179c0b52aa88..89c48a46fbc7 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/sdk_packaging.toml +++ b/sdk/servicebus/azure-mgmt-servicebus/sdk_packaging.toml @@ -2,6 +2,6 @@ package_name = "azure-mgmt-servicebus" package_pprint_name = "Service Bus Management" package_doc_id = "servicebus" -is_stable = true +is_stable = false sample_link = "" title = "ServiceBusManagementClient" diff --git a/sdk/servicebus/azure-mgmt-servicebus/setup.py b/sdk/servicebus/azure-mgmt-servicebus/setup.py index 69e15269be36..dd1da66bd85f 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/setup.py +++ b/sdk/servicebus/azure-mgmt-servicebus/setup.py @@ -49,7 +49,7 @@ 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", From afd94995a4e60b93a5b72bd111c108acb2f3a174 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Fri, 4 Jul 2025 20:58:33 +0800 Subject: [PATCH 2/2] update version --- sdk/servicebus/azure-mgmt-servicebus/CHANGELOG.md | 2 +- .../azure-mgmt-servicebus/azure/mgmt/servicebus/_version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/servicebus/azure-mgmt-servicebus/CHANGELOG.md b/sdk/servicebus/azure-mgmt-servicebus/CHANGELOG.md index 5be369937c61..645e60f2bdf3 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-mgmt-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 0.0.0(it should be perview) (2025-07-21) +## 10.0.0 (2025-07-21) diff --git a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_version.py b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_version.py index 9bd4c9b55137..9f8bb24bdd99 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_version.py +++ b/sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "0.0.0" +VERSION = "10.0.0"