From b46fd18bf28f4f273fd86157f406ad299b856f1e Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Thu, 12 Jun 2025 15:39:13 -0400 Subject: [PATCH 1/5] temp --- sdk/core/azure-core/azure/core/serialization.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sdk/core/azure-core/azure/core/serialization.py b/sdk/core/azure-core/azure/core/serialization.py index 59c0fb00f5c0..19bc92e1e887 100644 --- a/sdk/core/azure-core/azure/core/serialization.py +++ b/sdk/core/azure-core/azure/core/serialization.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- import base64 from json import JSONEncoder -from typing import Union, cast, Any +from typing import List, Union, cast, Any from datetime import datetime, date, time, timedelta from datetime import timezone @@ -140,3 +140,18 @@ def is_generated_model(obj: Any) -> bool: :rtype: bool """ return bool(getattr(obj, "_is_model", False) or hasattr(obj, "_attribute_map")) + +def attribute_list(obj: Any) -> List[str]: + """Get a list of attribute names for a generated SDK model. + + :param obj: The object to get attributes from. + :type obj: any + :return: A list of attribute names. + :rtype: List[str] + """ + if not is_generated_model(obj): + raise TypeError("Object is not a generated SDK model.") + if hasattr(obj, "_attribute_map"): + # msrest model + return list(obj._attribute_map.keys()) + From fa20924bb799d78bcd12196f04fb7180a34b6d05 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Thu, 12 Jun 2025 15:51:50 -0400 Subject: [PATCH 2/5] merge --- .../azure-mgmt-oracledatabase/CHANGELOG.md | 95 + .../azure-mgmt-oracledatabase/MANIFEST.in | 1 - .../azure-mgmt-oracledatabase/README.md | 6 +- .../azure-mgmt-oracledatabase/_meta.json | 11 - .../azure-mgmt-oracledatabase/_metadata.json | 7 + .../apiview-properties.json | 353 + .../azure-mgmt-oracledatabase/assets.json | 6 - .../azure/mgmt/oracledatabase/__init__.py | 14 +- ...cle_database_mgmt_client.py => _client.py} | 168 +- .../mgmt/oracledatabase/_configuration.py | 24 +- .../azure/mgmt/oracledatabase/_patch.py | 9 +- .../{_vendor.py => _utils/__init__.py} | 12 +- .../mgmt/oracledatabase/_utils/model_base.py | 1232 ++ .../serialization.py} | 568 +- .../azure/mgmt/oracledatabase/_validation.py | 50 + .../azure/mgmt/oracledatabase/_version.py | 4 +- .../azure/mgmt/oracledatabase/aio/__init__.py | 14 +- ...cle_database_mgmt_client.py => _client.py} | 170 +- .../mgmt/oracledatabase/aio/_configuration.py | 24 +- .../azure/mgmt/oracledatabase/aio/_patch.py | 9 +- .../oracledatabase/aio/operations/__init__.py | 78 +- ..._autonomous_database_backups_operations.py | 751 - ...mous_database_character_sets_operations.py | 200 - ...base_national_character_sets_operations.py | 204 - ...autonomous_database_versions_operations.py | 196 - .../_autonomous_databases_operations.py | 1650 -- ...loud_exadata_infrastructures_operations.py | 915 - .../_cloud_vm_clusters_operations.py | 1316 -- .../aio/operations/_db_nodes_operations.py | 423 - .../aio/operations/_db_servers_operations.py | 207 - .../_db_system_shapes_operations.py | 196 - .../_dns_private_views_operations.py | 196 - .../_dns_private_zones_operations.py | 196 - .../aio/operations/_gi_versions_operations.py | 195 - .../aio/operations/_operations.py | 12305 ++++++++++++- .../_oracle_subscriptions_operations.py | 907 - .../oracledatabase/aio/operations/_patch.py | 9 +- .../operations/_system_versions_operations.py | 196 - .../_virtual_network_addresses_operations.py | 538 - .../mgmt/oracledatabase/models/__init__.py | 405 +- ...atabase_mgmt_client_enums.py => _enums.py} | 127 +- .../mgmt/oracledatabase/models/_models.py | 7904 +++++++++ .../mgmt/oracledatabase/models/_models_py3.py | 7339 -------- .../mgmt/oracledatabase/models/_patch.py | 9 +- .../oracledatabase/operations/__init__.py | 78 +- ..._autonomous_database_backups_operations.py | 931 - ...mous_database_character_sets_operations.py | 256 - ...base_national_character_sets_operations.py | 260 - ...autonomous_database_versions_operations.py | 256 - .../_autonomous_databases_operations.py | 2002 --- ...loud_exadata_infrastructures_operations.py | 1145 -- .../_cloud_vm_clusters_operations.py | 1601 -- .../operations/_db_nodes_operations.py | 520 - .../operations/_db_servers_operations.py | 286 - .../_db_system_shapes_operations.py | 253 - .../_dns_private_views_operations.py | 255 - .../_dns_private_zones_operations.py | 253 - .../operations/_gi_versions_operations.py | 253 - .../oracledatabase/operations/_operations.py | 14701 +++++++++++++++- .../_oracle_subscriptions_operations.py | 1106 -- .../mgmt/oracledatabase/operations/_patch.py | 9 +- .../operations/_system_versions_operations.py | 253 - .../_virtual_network_addresses_operations.py | 686 - .../autonomous_database_backup_create.py | 52 - .../autonomous_database_backup_delete.py | 42 - .../autonomous_database_backup_get.py | 43 - ...tonomous_database_backup_list_by_parent.py | 43 - ...change_disaster_recovery_configuration.py} | 11 +- ...database_character_set_list_by_location.py | 42 - .../autonomous_database_clone_create.py | 62 - .../autonomous_database_create.py | 61 - .../autonomous_database_delete.py | 41 - .../autonomous_database_failover.py | 8 +- .../autonomous_database_generate_wallet.py | 8 +- ...onomous_database_list_by_resource_group.py | 6 +- ...utonomous_database_list_by_subscription.py | 40 - ...ous_database_national_character_set_get.py | 42 - ...national_character_set_list_by_location.py | 42 - .../autonomous_database_restore.py | 8 +- .../autonomous_database_switchover.py | 8 +- .../autonomous_database_version_get.py | 42 - ...omous_database_version_list_by_location.py | 42 - .../generated_samples/db_nodes_action.py | 8 +- .../generated_samples/db_nodes_get.py | 43 - .../db_nodes_list_by_parent.py | 43 - .../generated_samples/db_servers_get.py | 43 - .../db_servers_list_by_parent.py | 43 - .../generated_samples/db_system_shapes_get.py | 42 - .../db_system_shapes_list_by_location.py | 6 +- .../dns_private_views_get.py | 42 - .../dns_private_zones_get.py | 42 - .../exa_infra_add_storage_capacity.py | 6 +- .../generated_samples/exa_infra_create.py | 50 - .../generated_samples/exa_infra_delete.py | 41 - .../generated_samples/exa_infra_get.py | 42 - .../exa_infra_list_by_resource_group.py | 42 - .../exa_infra_list_by_subscription.py | 40 - ...vm_clusters_remove_vms_maximum_set_gen.py} | 30 +- ...ascale_db_nodes_action_maximum_set_gen.py} | 18 +- ...db_nodes_list_by_parent_maximum_set_gen.py | 43 + ...b_storage_vaults_create_maximum_set_gen.py | 58 + ..._storage_vaults_delete_maximum_set_gen.py} | 14 +- ..._db_storage_vaults_get_maximum_set_gen.py} | 14 +- ..._list_by_resource_group_maximum_set_gen.py | 42 + ...s_list_by_subscription_maximum_set_gen.py} | 10 +- ..._storage_vaults_update_maximum_set_gen.py} | 17 +- ...=> flex_components_get_maximum_set_gen.py} | 12 +- ...ponents_list_by_parent_maximum_set_gen.py} | 10 +- ... gi_minor_versions_get_maximum_set_gen.py} | 13 +- ...ersions_list_by_parent_maximum_set_gen.py} | 11 +- ...sions_list_by_location_maximum_set_gen.py} | 8 +- ...sions_list_by_location_minimum_set_gen.py} | 10 +- .../generated_samples/operations_list.py | 4 +- ..._subscriptions_add_azure_subscriptions.py} | 12 +- .../oracle_subscriptions_get.py | 39 - ...cle_subscriptions_list_activation_links.py | 6 +- ...acle_subscriptions_list_by_subscription.py | 40 - ...ubscriptions_list_cloud_account_details.py | 6 +- ...riptions_list_saas_subscription_details.py | 6 +- .../virtual_network_addresses_create.py | 46 - .../virtual_network_addresses_delete.py | 42 - .../virtual_network_addresses_get.py | 43 - ...irtual_network_addresses_list_by_parent.py | 43 - .../generated_samples/vm_clusters_add_vms.py | 8 +- .../generated_samples/vm_clusters_create.py | 82 - .../vm_clusters_list_by_resource_group.py | 42 - .../vm_clusters_list_private_ip_addresses.py | 8 +- .../vm_clusters_remove_vms.py | 8 +- .../generated_tests/conftest.py | 35 + ..._autonomous_database_backups_operations.py | 110 + ...omous_database_backups_operations_async.py | 117 + ...mous_database_character_sets_operations.py | 40 + ...atabase_character_sets_operations_async.py | 41 + ...base_national_character_sets_operations.py | 40 + ...ational_character_sets_operations_async.py | 41 + ...autonomous_database_versions_operations.py | 40 + ...mous_database_versions_operations_async.py | 41 + ...se_mgmt_autonomous_databases_operations.py | 210 + ...t_autonomous_databases_operations_async.py | 227 + ...loud_exadata_infrastructures_operations.py | 185 + ...xadata_infrastructures_operations_async.py | 194 + ...abase_mgmt_cloud_vm_clusters_operations.py | 214 + ...mgmt_cloud_vm_clusters_operations_async.py | 225 + ...racle_database_mgmt_db_nodes_operations.py | 55 + ...database_mgmt_db_nodes_operations_async.py | 58 + ...cle_database_mgmt_db_servers_operations.py | 42 + ...tabase_mgmt_db_servers_operations_async.py | 43 + ...tabase_mgmt_db_system_shapes_operations.py | 40 + ..._mgmt_db_system_shapes_operations_async.py | 41 + ...abase_mgmt_dns_private_views_operations.py | 40 + ...mgmt_dns_private_views_operations_async.py | 41 + ...abase_mgmt_dns_private_zones_operations.py | 40 + ...mgmt_dns_private_zones_operations_async.py | 41 + ...abase_mgmt_exadb_vm_clusters_operations.py | 164 + ...mgmt_exadb_vm_clusters_operations_async.py | 173 + ...abase_mgmt_exascale_db_nodes_operations.py | 55 + ...mgmt_exascale_db_nodes_operations_async.py | 58 + ...t_exascale_db_storage_vaults_operations.py | 112 + ...cale_db_storage_vaults_operations_async.py | 119 + ...atabase_mgmt_flex_components_operations.py | 40 + ...e_mgmt_flex_components_operations_async.py | 41 + ...abase_mgmt_gi_minor_versions_operations.py | 42 + ...mgmt_gi_minor_versions_operations_async.py | 43 + ...le_database_mgmt_gi_versions_operations.py | 40 + ...abase_mgmt_gi_versions_operations_async.py | 41 + .../test_oracle_database_mgmt_operations.py | 27 + ...t_oracle_database_mgmt_operations_async.py | 28 + ...se_mgmt_oracle_subscriptions_operations.py | 133 + ...t_oracle_subscriptions_operations_async.py | 152 + ...atabase_mgmt_system_versions_operations.py | 40 + ...e_mgmt_system_versions_operations_async.py | 41 + ...mt_virtual_network_addresses_operations.py | 89 + ...tual_network_addresses_operations_async.py | 94 + .../azure-mgmt-oracledatabase/setup.py | 6 +- .../tests/conftest.py | 59 +- .../tests/test_cli_mgmt_oracledatabase.py | 41 - .../test_cli_mgmt_oracledatabase_async.py | 47 - ...onomous_databases_operations_async_test.py | 36 + ...mt_autonomous_databases_operations_test.py | 35 + ...a_infrastructures_operations_async_test.py | 36 + ...exadata_infrastructures_operations_test.py | 35 + ...cloud_vm_clusters_operations_async_test.py | 36 + ..._mgmt_cloud_vm_clusters_operations_test.py | 35 + ...exadb_vm_clusters_operations_async_test.py | 36 + ..._mgmt_exadb_vm_clusters_operations_test.py | 35 + ...db_storage_vaults_operations_async_test.py | 36 + ...scale_db_storage_vaults_operations_test.py | 35 + ...cle_database_mgmt_operations_async_test.py | 27 + ...st_oracle_database_mgmt_operations_test.py | 26 + .../tsp-location.yaml | 5 + sdk/servicebus/azure-servicebus/README.md | 6 +- .../azure-servicebus/TROUBLESHOOTING.md | 411 + .../azure-servicebus/samples/README.md | 4 +- .../samples/sync_samples/send_queue.py | 42 +- .../samples/sync_samples/send_topic.py | 39 +- 195 files changed, 42463 insertions(+), 28602 deletions(-) delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/_meta.json create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/_metadata.json create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/apiview-properties.json delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/assets.json rename sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/{_oracle_database_mgmt_client.py => _client.py} (71%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/{_vendor.py => _utils/__init__.py} (50%) create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/model_base.py rename sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/{_serialization.py => _utils/serialization.py} (83%) create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_validation.py rename sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/{_oracle_database_mgmt_client.py => _client.py} (71%) delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_backups_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_character_sets_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_national_character_sets_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_versions_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_databases_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_exadata_infrastructures_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_vm_clusters_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_nodes_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_servers_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_system_shapes_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_views_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_zones_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_versions_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_oracle_subscriptions_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_system_versions_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_virtual_network_addresses_operations.py rename sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/{_oracle_database_mgmt_client_enums.py => _enums.py} (84%) create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models_py3.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_backups_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_character_sets_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_national_character_sets_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_versions_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_databases_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_exadata_infrastructures_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_vm_clusters_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_nodes_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_servers_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_system_shapes_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_views_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_zones_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_versions_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_oracle_subscriptions_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_system_versions_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_virtual_network_addresses_operations.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_create.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_delete.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_list_by_parent.py rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{autonomous_database_shrink.py => autonomous_database_change_disaster_recovery_configuration.py} (74%) delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_list_by_location.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_clone_create.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_create.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_delete.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_subscription.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_list_by_location.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_list_by_location.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_list_by_parent.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_list_by_parent.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_create.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_delete.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_resource_group.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_subscription.py rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{oracle_subscriptions_create.py => exadb_vm_clusters_remove_vms_maximum_set_gen.py} (62%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{autonomous_database_character_set_get.py => exascale_db_nodes_action_maximum_set_gen.py} (71%) create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_list_by_parent_maximum_set_gen.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_create_maximum_set_gen.py rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{vm_clusters_delete.py => exascale_db_storage_vaults_delete_maximum_set_gen.py} (74%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{vm_clusters_get.py => exascale_db_storage_vaults_get_maximum_set_gen.py} (74%) create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_resource_group_maximum_set_gen.py rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{vm_clusters_list_by_subscription.py => exascale_db_storage_vaults_list_by_subscription_maximum_set_gen.py} (76%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{autonomous_database_get.py => exascale_db_storage_vaults_update_maximum_set_gen.py} (71%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{gi_versions_get.py => flex_components_get_maximum_set_gen.py} (77%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{system_versions_list_by_location.py => flex_components_list_by_parent_maximum_set_gen.py} (76%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{system_versions_get.py => gi_minor_versions_get_maximum_set_gen.py} (76%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{dns_private_zones_list_by_location.py => gi_minor_versions_list_by_parent_maximum_set_gen.py} (76%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{gi_versions_list_by_location.py => gi_versions_list_by_location_maximum_set_gen.py} (80%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{dns_private_views_list_by_location.py => gi_versions_list_by_location_minimum_set_gen.py} (76%) rename sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/{oracle_subscriptions_delete.py => oracle_subscriptions_add_azure_subscriptions.py} (74%) delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_by_subscription.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_create.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_delete.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_get.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_list_by_parent.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_create.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_resource_group.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/conftest.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations_async.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_cli_mgmt_oracledatabase.py delete mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_cli_mgmt_oracledatabase_async.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_autonomous_databases_operations_async_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_autonomous_databases_operations_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_operations_async_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_operations_test.py create mode 100644 sdk/oracledatabase/azure-mgmt-oracledatabase/tsp-location.yaml create mode 100644 sdk/servicebus/azure-servicebus/TROUBLESHOOTING.md diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/CHANGELOG.md b/sdk/oracledatabase/azure-mgmt-oracledatabase/CHANGELOG.md index 833882b21937..e5bb4873e32a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/CHANGELOG.md +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/CHANGELOG.md @@ -1,5 +1,100 @@ # Release History +## 2.0.0 (2025-06-05) + +### Features Added + + - Client `OracleDatabaseMgmtClient` added operation group `list_actions` + - Client `OracleDatabaseMgmtClient` added operation group `gi_minor_versions` + - Client `OracleDatabaseMgmtClient` added operation group `flex_components` + - Client `OracleDatabaseMgmtClient` added operation group `exadb_vm_clusters` + - Client `OracleDatabaseMgmtClient` added operation group `exascale_db_nodes` + - Client `OracleDatabaseMgmtClient` added operation group `exascale_db_storage_vaults` + - Model `AutonomousDatabaseBaseProperties` added property `time_disaster_recovery_role_changed` + - Model `AutonomousDatabaseBaseProperties` added property `remote_disaster_recovery_configuration` + - Model `AutonomousDatabaseCloneProperties` added property `time_disaster_recovery_role_changed` + - Model `AutonomousDatabaseCloneProperties` added property `remote_disaster_recovery_configuration` + - Model `AutonomousDatabaseProperties` added property `time_disaster_recovery_role_changed` + - Model `AutonomousDatabaseProperties` added property `remote_disaster_recovery_configuration` + - Model `CloudExadataInfrastructureProperties` added property `defined_file_system_configuration` + - Model `CloudExadataInfrastructureProperties` added property `database_server_type` + - Model `CloudExadataInfrastructureProperties` added property `storage_server_type` + - Model `CloudExadataInfrastructureProperties` added property `compute_model` + - Model `CloudVmClusterProperties` added property `file_system_configuration_details` + - Model `CloudVmClusterProperties` added property `compute_model` + - Model `CloudVmClusterUpdateProperties` added property `file_system_configuration_details` + - Enum `DataBaseType` added member `CLONE_FROM_BACKUP_TIMESTAMP` + - Enum `DataBaseType` added member `CROSS_REGION_DISASTER_RECOVERY` + - Model `DbServerProperties` added property `compute_model` + - Model `DbSystemShapeProperties` added property `shape_name` + - Model `DbSystemShapeProperties` added property `compute_model` + - Model `DbSystemShapeProperties` added property `are_server_types_supported` + - Model `DbSystemShapeProperties` added property `display_name` + - Model `OracleSubscriptionProperties` added property `azure_subscription_ids` + - Model `OracleSubscriptionProperties` added property `add_subscription_operation_state` + - Model `OracleSubscriptionProperties` added property `last_operation_status_detail` + - Model `PeerDbDetails` added property `peer_db_ocid` + - Model `PeerDbDetails` added property `peer_db_location` + - Added enum `AddSubscriptionOperationState` + - Added model `AutonomousDatabaseCrossRegionDisasterRecoveryProperties` + - Added model `AutonomousDatabaseFromBackupTimestampProperties` + - Added model `AzureSubscriptions` + - Added model `DbActionResponse` + - Added model `DbNodeDetails` + - Added model `DefinedFileSystemConfiguration` + - Added model `DisasterRecoveryConfigurationDetails` + - Added model `ExadbVmCluster` + - Added enum `ExadbVmClusterLifecycleState` + - Added model `ExadbVmClusterProperties` + - Added model `ExadbVmClusterStorageDetails` + - Added model `ExadbVmClusterUpdate` + - Added model `ExadbVmClusterUpdateProperties` + - Added model `ExascaleDbNode` + - Added model `ExascaleDbNodeProperties` + - Added model `ExascaleDbStorageDetails` + - Added model `ExascaleDbStorageInputDetails` + - Added model `ExascaleDbStorageVault` + - Added enum `ExascaleDbStorageVaultLifecycleState` + - Added model `ExascaleDbStorageVaultProperties` + - Added model `ExascaleDbStorageVaultTagsUpdate` + - Added model `FileSystemConfigurationDetails` + - Added model `FlexComponent` + - Added model `FlexComponentProperties` + - Added model `GiMinorVersion` + - Added model `GiMinorVersionProperties` + - Added enum `GridImageType` + - Added enum `HardwareType` + - Added model `RemoveVirtualMachineFromExadbVmClusterDetails` + - Added enum `ShapeFamily` + - Added enum `SystemShapes` + - Model `AutonomousDatabaseBackupsOperations` added method `list_by_parent` + - Model `AutonomousDatabasesOperations` added method `begin_change_disaster_recovery_configuration` + - Model `DbNodesOperations` added method `list_by_parent` + - Model `DbServersOperations` added method `list_by_parent` + - Model `DbSystemShapesOperations` added parameter `zone` in method `list_by_location` + - Model `GiVersionsOperations` added parameter `shape` in method `list_by_location` + - Model `GiVersionsOperations` added parameter `zone` in method `list_by_location` + - Model `OracleSubscriptionsOperations` added method `begin_add_azure_subscriptions` + - Model `VirtualNetworkAddressesOperations` added method `list_by_parent` + - Added operation group `ExadbVmClustersOperations` + - Added operation group `ExascaleDbNodesOperations` + - Added operation group `ExascaleDbStorageVaultsOperations` + - Added operation group `FlexComponentsOperations` + - Added operation group `GiMinorVersionsOperations` + - Added operation group `ListActionsOperations` + +### Breaking Changes + + - This version introduces new hybrid models which have dual dictionary and model nature. And please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration. + - Deleted or renamed model `UpdateAction` + - Deleted or renamed model `ValidationError` + - Deleted or renamed model `ValidationResult` + - Deleted or renamed model `ValidationStatus` + - Deleted or renamed method `AutonomousDatabaseBackupsOperations.list_by_autonomous_database` + - Deleted or renamed method `DbNodesOperations.list_by_cloud_vm_cluster` + - Deleted or renamed method `DbServersOperations.list_by_cloud_exadata_infrastructure` + - Deleted or renamed method `VirtualNetworkAddressesOperations.list_by_cloud_vm_cluster` + ## 1.0.0 (2024-07-04) ### Other Changes diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/MANIFEST.in b/sdk/oracledatabase/azure-mgmt-oracledatabase/MANIFEST.in index 22faeb8d9ebc..c6e577cafbec 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/MANIFEST.in +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/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/oracledatabase/azure-mgmt-oracledatabase/README.md b/sdk/oracledatabase/azure-mgmt-oracledatabase/README.md index d8be03bef386..50195d4b3844 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/README.md +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Oracledatabase Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/_meta.json b/sdk/oracledatabase/azure-mgmt-oracledatabase/_meta.json deleted file mode 100644 index 42c469843afc..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "a83c34348fbd25ad79a05e36816b91da0122b583", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.13.19", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/oracle/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.19 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/oracle/resource-manager/readme.md" -} \ No newline at end of file diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/_metadata.json b/sdk/oracledatabase/azure-mgmt-oracledatabase/_metadata.json new file mode 100644 index 000000000000..c358316ce3bb --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/_metadata.json @@ -0,0 +1,7 @@ +{ + "apiVersion": "2025-03-01", + "commit": "e411473e135e0f0f3c763565ee401be34ccd9f99", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/oracle/Oracle.Database.Management", + "emitterVersion": "0.45.0" +} \ No newline at end of file diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/apiview-properties.json b/sdk/oracledatabase/azure-mgmt-oracledatabase/apiview-properties.json new file mode 100644 index 000000000000..cc7cba26ca50 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/apiview-properties.json @@ -0,0 +1,353 @@ +{ + "CrossLanguagePackageId": "Oracle.Database", + "CrossLanguageDefinitionId": { + "azure.mgmt.oracledatabase.models.ActivationLinks": "Oracle.Database.ActivationLinks", + "azure.mgmt.oracledatabase.models.AddRemoveDbNode": "Oracle.Database.AddRemoveDbNode", + "azure.mgmt.oracledatabase.models.AllConnectionStringType": "Oracle.Database.AllConnectionStringType", + "azure.mgmt.oracledatabase.models.ApexDetailsType": "Oracle.Database.ApexDetailsType", + "azure.mgmt.oracledatabase.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.oracledatabase.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.oracledatabase.models.AutonomousDatabase": "Oracle.Database.AutonomousDatabase", + "azure.mgmt.oracledatabase.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup": "Oracle.Database.AutonomousDatabaseBackup", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupProperties": "Oracle.Database.AutonomousDatabaseBackupProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseBaseProperties": "Oracle.Database.AutonomousDatabaseBaseProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet": "Oracle.Database.AutonomousDatabaseCharacterSet", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSetProperties": "Oracle.Database.AutonomousDatabaseCharacterSetProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseCloneProperties": "Oracle.Database.AutonomousDatabaseCloneProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseCrossRegionDisasterRecoveryProperties": "Oracle.Database.AutonomousDatabaseCrossRegionDisasterRecoveryProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseFromBackupTimestampProperties": "Oracle.Database.AutonomousDatabaseFromBackupTimestampProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet": "Oracle.Database.AutonomousDatabaseNationalCharacterSet", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSetProperties": "Oracle.Database.AutonomousDatabaseNationalCharacterSetProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseProperties": "Oracle.Database.AutonomousDatabaseProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary": "Oracle.Database.AutonomousDatabaseStandbySummary", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdate": "Oracle.Database.AutonomousDatabaseUpdate", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdateProperties": "Oracle.Database.AutonomousDatabaseUpdateProperties", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile": "Oracle.Database.AutonomousDatabaseWalletFile", + "azure.mgmt.oracledatabase.models.AutonomousDbVersion": "Oracle.Database.AutonomousDbVersion", + "azure.mgmt.oracledatabase.models.AutonomousDbVersionProperties": "Oracle.Database.AutonomousDbVersionProperties", + "azure.mgmt.oracledatabase.models.AzureSubscriptions": "Oracle.Database.AzureSubscriptions", + "azure.mgmt.oracledatabase.models.CloudAccountDetails": "Oracle.Database.CloudAccountDetails", + "azure.mgmt.oracledatabase.models.CloudExadataInfrastructure": "Oracle.Database.CloudExadataInfrastructure", + "azure.mgmt.oracledatabase.models.CloudExadataInfrastructureProperties": "Oracle.Database.CloudExadataInfrastructureProperties", + "azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.oracledatabase.models.CloudVmCluster": "Oracle.Database.CloudVmCluster", + "azure.mgmt.oracledatabase.models.CloudVmClusterProperties": "Oracle.Database.CloudVmClusterProperties", + "azure.mgmt.oracledatabase.models.CloudVmClusterUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.oracledatabase.models.CloudVmClusterUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.oracledatabase.models.ConnectionStringType": "Oracle.Database.ConnectionStringType", + "azure.mgmt.oracledatabase.models.ConnectionUrlType": "Oracle.Database.ConnectionUrlType", + "azure.mgmt.oracledatabase.models.CustomerContact": "Oracle.Database.CustomerContact", + "azure.mgmt.oracledatabase.models.DataCollectionOptions": "Oracle.Database.DataCollectionOptions", + "azure.mgmt.oracledatabase.models.DayOfWeek": "Oracle.Database.DayOfWeek", + "azure.mgmt.oracledatabase.models.DayOfWeekUpdate": "Oracle.Database.DayOfWeekUpdate", + "azure.mgmt.oracledatabase.models.DbActionResponse": "Oracle.Database.DbActionResponse", + "azure.mgmt.oracledatabase.models.DbIormConfig": "Oracle.Database.DbIormConfig", + "azure.mgmt.oracledatabase.models.DbNode": "Oracle.Database.DbNode", + "azure.mgmt.oracledatabase.models.DbNodeAction": "Oracle.Database.DbNodeAction", + "azure.mgmt.oracledatabase.models.DbNodeDetails": "Oracle.Database.DbNodeDetails", + "azure.mgmt.oracledatabase.models.DbNodeProperties": "Oracle.Database.DbNodeProperties", + "azure.mgmt.oracledatabase.models.DbServer": "Oracle.Database.DbServer", + "azure.mgmt.oracledatabase.models.DbServerPatchingDetails": "Oracle.Database.DbServerPatchingDetails", + "azure.mgmt.oracledatabase.models.DbServerProperties": "Oracle.Database.DbServerProperties", + "azure.mgmt.oracledatabase.models.DbSystemShape": "Oracle.Database.DbSystemShape", + "azure.mgmt.oracledatabase.models.DbSystemShapeProperties": "Oracle.Database.DbSystemShapeProperties", + "azure.mgmt.oracledatabase.models.DefinedFileSystemConfiguration": "Oracle.Database.DefinedFileSystemConfiguration", + "azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails": "Oracle.Database.DisasterRecoveryConfigurationDetails", + "azure.mgmt.oracledatabase.models.DnsPrivateView": "Oracle.Database.DnsPrivateView", + "azure.mgmt.oracledatabase.models.DnsPrivateViewProperties": "Oracle.Database.DnsPrivateViewProperties", + "azure.mgmt.oracledatabase.models.DnsPrivateZone": "Oracle.Database.DnsPrivateZone", + "azure.mgmt.oracledatabase.models.DnsPrivateZoneProperties": "Oracle.Database.DnsPrivateZoneProperties", + "azure.mgmt.oracledatabase.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.oracledatabase.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.oracledatabase.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.oracledatabase.models.EstimatedPatchingTime": "Oracle.Database.EstimatedPatchingTime", + "azure.mgmt.oracledatabase.models.ExadataIormConfig": "Oracle.Database.ExadataIormConfig", + "azure.mgmt.oracledatabase.models.ExadbVmCluster": "Oracle.Database.ExadbVmCluster", + "azure.mgmt.oracledatabase.models.ExadbVmClusterProperties": "Oracle.Database.ExadbVmClusterProperties", + "azure.mgmt.oracledatabase.models.ExadbVmClusterStorageDetails": "Oracle.Database.ExadbVmClusterStorageDetails", + "azure.mgmt.oracledatabase.models.ExadbVmClusterUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.oracledatabase.models.ExadbVmClusterUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.oracledatabase.models.ExascaleDbNode": "Oracle.Database.ExascaleDbNode", + "azure.mgmt.oracledatabase.models.ExascaleDbNodeProperties": "Oracle.Database.ExascaleDbNodeProperties", + "azure.mgmt.oracledatabase.models.ExascaleDbStorageDetails": "Oracle.Database.ExascaleDbStorageDetails", + "azure.mgmt.oracledatabase.models.ExascaleDbStorageInputDetails": "Oracle.Database.ExascaleDbStorageInputDetails", + "azure.mgmt.oracledatabase.models.ExascaleDbStorageVault": "Oracle.Database.ExascaleDbStorageVault", + "azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultProperties": "Oracle.Database.ExascaleDbStorageVaultProperties", + "azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultTagsUpdate": "Azure.ResourceManager.Foundations.TagsUpdateModel", + "azure.mgmt.oracledatabase.models.FileSystemConfigurationDetails": "Oracle.Database.FileSystemConfigurationDetails", + "azure.mgmt.oracledatabase.models.FlexComponent": "Oracle.Database.FlexComponent", + "azure.mgmt.oracledatabase.models.FlexComponentProperties": "Oracle.Database.FlexComponentProperties", + "azure.mgmt.oracledatabase.models.GenerateAutonomousDatabaseWalletDetails": "Oracle.Database.GenerateAutonomousDatabaseWalletDetails", + "azure.mgmt.oracledatabase.models.GiMinorVersion": "Oracle.Database.GiMinorVersion", + "azure.mgmt.oracledatabase.models.GiMinorVersionProperties": "Oracle.Database.GiMinorVersionProperties", + "azure.mgmt.oracledatabase.models.GiVersion": "Oracle.Database.GiVersion", + "azure.mgmt.oracledatabase.models.GiVersionProperties": "Oracle.Database.GiVersionProperties", + "azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails": "Oracle.Database.LongTermBackUpScheduleDetails", + "azure.mgmt.oracledatabase.models.MaintenanceWindow": "Oracle.Database.MaintenanceWindow", + "azure.mgmt.oracledatabase.models.Month": "Oracle.Database.Month", + "azure.mgmt.oracledatabase.models.NsgCidr": "Oracle.Database.NsgCidr", + "azure.mgmt.oracledatabase.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.oracledatabase.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.oracledatabase.models.OracleSubscription": "Oracle.Database.OracleSubscription", + "azure.mgmt.oracledatabase.models.OracleSubscriptionProperties": "Oracle.Database.OracleSubscriptionProperties", + "azure.mgmt.oracledatabase.models.OracleSubscriptionUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.oracledatabase.models.OracleSubscriptionUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.oracledatabase.models.PeerDbDetails": "Oracle.Database.PeerDbDetails", + "azure.mgmt.oracledatabase.models.Plan": "Azure.ResourceManager.CommonTypes.Plan", + "azure.mgmt.oracledatabase.models.PlanUpdate": "Oracle.Database.PlanUpdate", + "azure.mgmt.oracledatabase.models.PortRange": "Oracle.Database.PortRange", + "azure.mgmt.oracledatabase.models.PrivateIpAddressesFilter": "Oracle.Database.PrivateIpAddressesFilter", + "azure.mgmt.oracledatabase.models.PrivateIpAddressProperties": "Oracle.Database.PrivateIpAddressProperties", + "azure.mgmt.oracledatabase.models.ProfileType": "Oracle.Database.ProfileType", + "azure.mgmt.oracledatabase.models.RemoveVirtualMachineFromExadbVmClusterDetails": "Oracle.Database.RemoveVirtualMachineFromExadbVmClusterDetails", + "azure.mgmt.oracledatabase.models.RestoreAutonomousDatabaseDetails": "Oracle.Database.RestoreAutonomousDatabaseDetails", + "azure.mgmt.oracledatabase.models.SaasSubscriptionDetails": "Oracle.Database.SaasSubscriptionDetails", + "azure.mgmt.oracledatabase.models.ScheduledOperationsType": "Oracle.Database.ScheduledOperationsType", + "azure.mgmt.oracledatabase.models.ScheduledOperationsTypeUpdate": "Oracle.Database.ScheduledOperationsTypeUpdate", + "azure.mgmt.oracledatabase.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.oracledatabase.models.SystemVersion": "Oracle.Database.SystemVersion", + "azure.mgmt.oracledatabase.models.SystemVersionProperties": "Oracle.Database.SystemVersionProperties", + "azure.mgmt.oracledatabase.models.VirtualNetworkAddress": "Oracle.Database.VirtualNetworkAddress", + "azure.mgmt.oracledatabase.models.VirtualNetworkAddressProperties": "Oracle.Database.VirtualNetworkAddressProperties", + "azure.mgmt.oracledatabase.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.oracledatabase.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.oracledatabase.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.oracledatabase.models.Preference": "Oracle.Database.Preference", + "azure.mgmt.oracledatabase.models.MonthName": "Oracle.Database.MonthName", + "azure.mgmt.oracledatabase.models.DayOfWeekName": "Oracle.Database.DayOfWeekName", + "azure.mgmt.oracledatabase.models.PatchingMode": "Oracle.Database.PatchingMode", + "azure.mgmt.oracledatabase.models.AzureResourceProvisioningState": "Oracle.Database.AzureResourceProvisioningState", + "azure.mgmt.oracledatabase.models.CloudExadataInfrastructureLifecycleState": "Oracle.Database.CloudExadataInfrastructureLifecycleState", + "azure.mgmt.oracledatabase.models.ComputeModel": "Oracle.Database.ComputeModel", + "azure.mgmt.oracledatabase.models.DbServerPatchingStatus": "Oracle.Database.DbServerPatchingStatus", + "azure.mgmt.oracledatabase.models.DbServerProvisioningState": "Oracle.Database.DbServerProvisioningState", + "azure.mgmt.oracledatabase.models.ResourceProvisioningState": "Azure.ResourceManager.ResourceProvisioningState", + "azure.mgmt.oracledatabase.models.LicenseModel": "Oracle.Database.LicenseModel", + "azure.mgmt.oracledatabase.models.DiskRedundancy": "Oracle.Database.DiskRedundancy", + "azure.mgmt.oracledatabase.models.CloudVmClusterLifecycleState": "Oracle.Database.CloudVmClusterLifecycleState", + "azure.mgmt.oracledatabase.models.IormLifecycleState": "Oracle.Database.IormLifecycleState", + "azure.mgmt.oracledatabase.models.Objective": "Oracle.Database.Objective", + "azure.mgmt.oracledatabase.models.VirtualNetworkAddressLifecycleState": "Oracle.Database.VirtualNetworkAddressLifecycleState", + "azure.mgmt.oracledatabase.models.OracleSubscriptionProvisioningState": "Oracle.Database.OracleSubscriptionProvisioningState", + "azure.mgmt.oracledatabase.models.CloudAccountProvisioningState": "Oracle.Database.CloudAccountProvisioningState", + "azure.mgmt.oracledatabase.models.Intent": "Oracle.Database.Intent", + "azure.mgmt.oracledatabase.models.AddSubscriptionOperationState": "Oracle.Database.AddSubscriptionOperationState", + "azure.mgmt.oracledatabase.models.DbNodeProvisioningState": "Oracle.Database.DbNodeProvisioningState", + "azure.mgmt.oracledatabase.models.DbNodeMaintenanceType": "Oracle.Database.DbNodeMaintenanceType", + "azure.mgmt.oracledatabase.models.DbNodeActionEnum": "Oracle.Database.DbNodeActionEnum", + "azure.mgmt.oracledatabase.models.SystemShapes": "Oracle.Database.SystemShapes", + "azure.mgmt.oracledatabase.models.ShapeFamily": "Oracle.Database.ShapeFamily", + "azure.mgmt.oracledatabase.models.DnsPrivateViewsLifecycleState": "Oracle.Database.DnsPrivateViewsLifecycleState", + "azure.mgmt.oracledatabase.models.DnsPrivateZonesLifecycleState": "Oracle.Database.DnsPrivateZonesLifecycleState", + "azure.mgmt.oracledatabase.models.ZoneType": "Oracle.Database.ZoneType", + "azure.mgmt.oracledatabase.models.HardwareType": "Oracle.Database.HardwareType", + "azure.mgmt.oracledatabase.models.DataBaseType": "Oracle.Database.DataBaseType", + "azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType": "Oracle.Database.AutonomousMaintenanceScheduleType", + "azure.mgmt.oracledatabase.models.WorkloadType": "Oracle.Database.WorkloadType", + "azure.mgmt.oracledatabase.models.DisasterRecoveryType": "Oracle.Database.DisasterRecoveryType", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState": "Oracle.Database.AutonomousDatabaseLifecycleState", + "azure.mgmt.oracledatabase.models.ConsumerGroup": "Oracle.Database.ConsumerGroup", + "azure.mgmt.oracledatabase.models.HostFormatType": "Oracle.Database.HostFormatType", + "azure.mgmt.oracledatabase.models.ProtocolType": "Oracle.Database.ProtocolType", + "azure.mgmt.oracledatabase.models.SessionModeType": "Oracle.Database.SessionModeType", + "azure.mgmt.oracledatabase.models.SyntaxFormatType": "Oracle.Database.SyntaxFormatType", + "azure.mgmt.oracledatabase.models.TlsAuthenticationType": "Oracle.Database.TlsAuthenticationType", + "azure.mgmt.oracledatabase.models.DataSafeStatusType": "Oracle.Database.DataSafeStatusType", + "azure.mgmt.oracledatabase.models.DatabaseEditionType": "Oracle.Database.DatabaseEditionType", + "azure.mgmt.oracledatabase.models.RepeatCadenceType": "Oracle.Database.RepeatCadenceType", + "azure.mgmt.oracledatabase.models.OpenModeType": "Oracle.Database.OpenModeType", + "azure.mgmt.oracledatabase.models.OperationsInsightsStatusType": "Oracle.Database.OperationsInsightsStatusType", + "azure.mgmt.oracledatabase.models.PermissionLevelType": "Oracle.Database.PermissionLevelType", + "azure.mgmt.oracledatabase.models.RoleType": "Oracle.Database.RoleType", + "azure.mgmt.oracledatabase.models.SourceType": "Oracle.Database.SourceType", + "azure.mgmt.oracledatabase.models.CloneType": "Oracle.Database.CloneType", + "azure.mgmt.oracledatabase.models.RefreshableModelType": "Oracle.Database.RefreshableModelType", + "azure.mgmt.oracledatabase.models.RefreshableStatusType": "Oracle.Database.RefreshableStatusType", + "azure.mgmt.oracledatabase.models.GenerateType": "Oracle.Database.GenerateType", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupLifecycleState": "Oracle.Database.AutonomousDatabaseBackupLifecycleState", + "azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupType": "Oracle.Database.AutonomousDatabaseBackupType", + "azure.mgmt.oracledatabase.models.ExadbVmClusterLifecycleState": "Oracle.Database.ExadbVmClusterLifecycleState", + "azure.mgmt.oracledatabase.models.GridImageType": "Oracle.Database.GridImageType", + "azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultLifecycleState": "Oracle.Database.ExascaleDbStorageVaultLifecycleState", + "azure.mgmt.oracledatabase.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.oracledatabase.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.oracledatabase.operations.CloudExadataInfrastructuresOperations.list_by_subscription": "Azure.ResourceManager.CloudExadataInfrastructures.listBySubscription", + "azure.mgmt.oracledatabase.aio.operations.CloudExadataInfrastructuresOperations.list_by_subscription": "Azure.ResourceManager.CloudExadataInfrastructures.listBySubscription", + "azure.mgmt.oracledatabase.operations.CloudExadataInfrastructuresOperations.begin_create_or_update": "Azure.ResourceManager.CloudExadataInfrastructures.createOrUpdate", + "azure.mgmt.oracledatabase.aio.operations.CloudExadataInfrastructuresOperations.begin_create_or_update": "Azure.ResourceManager.CloudExadataInfrastructures.createOrUpdate", + "azure.mgmt.oracledatabase.operations.CloudExadataInfrastructuresOperations.get": "Azure.ResourceManager.CloudExadataInfrastructures.get", + "azure.mgmt.oracledatabase.aio.operations.CloudExadataInfrastructuresOperations.get": "Azure.ResourceManager.CloudExadataInfrastructures.get", + "azure.mgmt.oracledatabase.operations.CloudExadataInfrastructuresOperations.begin_update": "Azure.ResourceManager.CloudExadataInfrastructures.update", + "azure.mgmt.oracledatabase.aio.operations.CloudExadataInfrastructuresOperations.begin_update": "Azure.ResourceManager.CloudExadataInfrastructures.update", + "azure.mgmt.oracledatabase.operations.CloudExadataInfrastructuresOperations.begin_delete": "Azure.ResourceManager.CloudExadataInfrastructures.delete", + "azure.mgmt.oracledatabase.aio.operations.CloudExadataInfrastructuresOperations.begin_delete": "Azure.ResourceManager.CloudExadataInfrastructures.delete", + "azure.mgmt.oracledatabase.operations.CloudExadataInfrastructuresOperations.list_by_resource_group": "Oracle.Database.CloudExadataInfrastructures.listByResourceGroup", + "azure.mgmt.oracledatabase.aio.operations.CloudExadataInfrastructuresOperations.list_by_resource_group": "Oracle.Database.CloudExadataInfrastructures.listByResourceGroup", + "azure.mgmt.oracledatabase.operations.CloudExadataInfrastructuresOperations.begin_add_storage_capacity": "Oracle.Database.CloudExadataInfrastructures.addStorageCapacity", + "azure.mgmt.oracledatabase.aio.operations.CloudExadataInfrastructuresOperations.begin_add_storage_capacity": "Oracle.Database.CloudExadataInfrastructures.addStorageCapacity", + "azure.mgmt.oracledatabase.operations.DbServersOperations.get": "Oracle.Database.DbServers.get", + "azure.mgmt.oracledatabase.aio.operations.DbServersOperations.get": "Oracle.Database.DbServers.get", + "azure.mgmt.oracledatabase.operations.DbServersOperations.list_by_parent": "Oracle.Database.DbServers.listByParent", + "azure.mgmt.oracledatabase.aio.operations.DbServersOperations.list_by_parent": "Oracle.Database.DbServers.listByParent", + "azure.mgmt.oracledatabase.operations.CloudVmClustersOperations.list_by_subscription": "Azure.ResourceManager.CloudVmClusters.listBySubscription", + "azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations.list_by_subscription": "Azure.ResourceManager.CloudVmClusters.listBySubscription", + "azure.mgmt.oracledatabase.operations.CloudVmClustersOperations.begin_create_or_update": "Azure.ResourceManager.CloudVmClusters.createOrUpdate", + "azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations.begin_create_or_update": "Azure.ResourceManager.CloudVmClusters.createOrUpdate", + "azure.mgmt.oracledatabase.operations.CloudVmClustersOperations.get": "Azure.ResourceManager.CloudVmClusters.get", + "azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations.get": "Azure.ResourceManager.CloudVmClusters.get", + "azure.mgmt.oracledatabase.operations.CloudVmClustersOperations.begin_update": "Azure.ResourceManager.CloudVmClusters.update", + "azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations.begin_update": "Azure.ResourceManager.CloudVmClusters.update", + "azure.mgmt.oracledatabase.operations.CloudVmClustersOperations.begin_delete": "Azure.ResourceManager.CloudVmClusters.delete", + "azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations.begin_delete": "Azure.ResourceManager.CloudVmClusters.delete", + "azure.mgmt.oracledatabase.operations.CloudVmClustersOperations.list_by_resource_group": "Oracle.Database.CloudVmClusters.listByResourceGroup", + "azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations.list_by_resource_group": "Oracle.Database.CloudVmClusters.listByResourceGroup", + "azure.mgmt.oracledatabase.operations.CloudVmClustersOperations.begin_add_vms": "Oracle.Database.CloudVmClusters.addVms", + "azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations.begin_add_vms": "Oracle.Database.CloudVmClusters.addVms", + "azure.mgmt.oracledatabase.operations.CloudVmClustersOperations.begin_remove_vms": "Oracle.Database.CloudVmClusters.removeVms", + "azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations.begin_remove_vms": "Oracle.Database.CloudVmClusters.removeVms", + "azure.mgmt.oracledatabase.operations.CloudVmClustersOperations.list_private_ip_addresses": "Oracle.Database.CloudVmClusters.listPrivateIpAddresses", + "azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations.list_private_ip_addresses": "Oracle.Database.CloudVmClusters.listPrivateIpAddresses", + "azure.mgmt.oracledatabase.operations.VirtualNetworkAddressesOperations.begin_create_or_update": "Azure.ResourceManager.VirtualNetworkAddresses.createOrUpdate", + "azure.mgmt.oracledatabase.aio.operations.VirtualNetworkAddressesOperations.begin_create_or_update": "Azure.ResourceManager.VirtualNetworkAddresses.createOrUpdate", + "azure.mgmt.oracledatabase.operations.VirtualNetworkAddressesOperations.get": "Azure.ResourceManager.VirtualNetworkAddresses.get", + "azure.mgmt.oracledatabase.aio.operations.VirtualNetworkAddressesOperations.get": "Azure.ResourceManager.VirtualNetworkAddresses.get", + "azure.mgmt.oracledatabase.operations.VirtualNetworkAddressesOperations.begin_delete": "Azure.ResourceManager.VirtualNetworkAddresses.delete", + "azure.mgmt.oracledatabase.aio.operations.VirtualNetworkAddressesOperations.begin_delete": "Azure.ResourceManager.VirtualNetworkAddresses.delete", + "azure.mgmt.oracledatabase.operations.VirtualNetworkAddressesOperations.list_by_parent": "Oracle.Database.VirtualNetworkAddresses.listByParent", + "azure.mgmt.oracledatabase.aio.operations.VirtualNetworkAddressesOperations.list_by_parent": "Oracle.Database.VirtualNetworkAddresses.listByParent", + "azure.mgmt.oracledatabase.operations.SystemVersionsOperations.get": "Oracle.Database.SystemVersions.get", + "azure.mgmt.oracledatabase.aio.operations.SystemVersionsOperations.get": "Oracle.Database.SystemVersions.get", + "azure.mgmt.oracledatabase.operations.SystemVersionsOperations.list_by_location": "Oracle.Database.SystemVersions.listByLocation", + "azure.mgmt.oracledatabase.aio.operations.SystemVersionsOperations.list_by_location": "Oracle.Database.SystemVersions.listByLocation", + "azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations.list_by_subscription": "Azure.ResourceManager.OracleSubscriptions.listBySubscription", + "azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations.list_by_subscription": "Azure.ResourceManager.OracleSubscriptions.listBySubscription", + "azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations.begin_create_or_update": "Azure.ResourceManager.OracleSubscriptions.createOrUpdate", + "azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations.begin_create_or_update": "Azure.ResourceManager.OracleSubscriptions.createOrUpdate", + "azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations.get": "Azure.ResourceManager.OracleSubscriptions.get", + "azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations.get": "Azure.ResourceManager.OracleSubscriptions.get", + "azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations.begin_update": "Oracle.Database.OracleSubscriptions.update", + "azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations.begin_update": "Oracle.Database.OracleSubscriptions.update", + "azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations.begin_delete": "Azure.ResourceManager.OracleSubscriptions.delete", + "azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations.begin_delete": "Azure.ResourceManager.OracleSubscriptions.delete", + "azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations.begin_list_cloud_account_details": "Oracle.Database.OracleSubscriptions.listCloudAccountDetails", + "azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations.begin_list_cloud_account_details": "Oracle.Database.OracleSubscriptions.listCloudAccountDetails", + "azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations.begin_list_saas_subscription_details": "Oracle.Database.OracleSubscriptions.listSaasSubscriptionDetails", + "azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations.begin_list_saas_subscription_details": "Oracle.Database.OracleSubscriptions.listSaasSubscriptionDetails", + "azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations.begin_list_activation_links": "Oracle.Database.OracleSubscriptions.listActivationLinks", + "azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations.begin_list_activation_links": "Oracle.Database.OracleSubscriptions.listActivationLinks", + "azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations.begin_add_azure_subscriptions": "Oracle.Database.OracleSubscriptions.addAzureSubscriptions", + "azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations.begin_add_azure_subscriptions": "Oracle.Database.OracleSubscriptions.addAzureSubscriptions", + "azure.mgmt.oracledatabase.operations.DbNodesOperations.get": "Oracle.Database.DbNodes.get", + "azure.mgmt.oracledatabase.aio.operations.DbNodesOperations.get": "Oracle.Database.DbNodes.get", + "azure.mgmt.oracledatabase.operations.DbNodesOperations.list_by_parent": "Oracle.Database.DbNodes.listByParent", + "azure.mgmt.oracledatabase.aio.operations.DbNodesOperations.list_by_parent": "Oracle.Database.DbNodes.listByParent", + "azure.mgmt.oracledatabase.operations.DbNodesOperations.begin_action": "Oracle.Database.DbNodes.action", + "azure.mgmt.oracledatabase.aio.operations.DbNodesOperations.begin_action": "Oracle.Database.DbNodes.action", + "azure.mgmt.oracledatabase.operations.GiVersionsOperations.get": "Oracle.Database.GiVersions.get", + "azure.mgmt.oracledatabase.aio.operations.GiVersionsOperations.get": "Oracle.Database.GiVersions.get", + "azure.mgmt.oracledatabase.operations.GiVersionsOperations.list_by_location": "Oracle.Database.GiVersions.listByLocation", + "azure.mgmt.oracledatabase.aio.operations.GiVersionsOperations.list_by_location": "Oracle.Database.GiVersions.listByLocation", + "azure.mgmt.oracledatabase.operations.GiMinorVersionsOperations.list_by_parent": "Oracle.Database.GiMinorVersions.listByParent", + "azure.mgmt.oracledatabase.aio.operations.GiMinorVersionsOperations.list_by_parent": "Oracle.Database.GiMinorVersions.listByParent", + "azure.mgmt.oracledatabase.operations.GiMinorVersionsOperations.get": "Oracle.Database.GiMinorVersions.get", + "azure.mgmt.oracledatabase.aio.operations.GiMinorVersionsOperations.get": "Oracle.Database.GiMinorVersions.get", + "azure.mgmt.oracledatabase.operations.DbSystemShapesOperations.get": "Oracle.Database.DbSystemShapes.get", + "azure.mgmt.oracledatabase.aio.operations.DbSystemShapesOperations.get": "Oracle.Database.DbSystemShapes.get", + "azure.mgmt.oracledatabase.operations.DbSystemShapesOperations.list_by_location": "Oracle.Database.DbSystemShapes.listByLocation", + "azure.mgmt.oracledatabase.aio.operations.DbSystemShapesOperations.list_by_location": "Oracle.Database.DbSystemShapes.listByLocation", + "azure.mgmt.oracledatabase.operations.DnsPrivateViewsOperations.get": "Oracle.Database.DnsPrivateViews.get", + "azure.mgmt.oracledatabase.aio.operations.DnsPrivateViewsOperations.get": "Oracle.Database.DnsPrivateViews.get", + "azure.mgmt.oracledatabase.operations.DnsPrivateViewsOperations.list_by_location": "Oracle.Database.DnsPrivateViews.listByLocation", + "azure.mgmt.oracledatabase.aio.operations.DnsPrivateViewsOperations.list_by_location": "Oracle.Database.DnsPrivateViews.listByLocation", + "azure.mgmt.oracledatabase.operations.DnsPrivateZonesOperations.get": "Oracle.Database.DnsPrivateZones.get", + "azure.mgmt.oracledatabase.aio.operations.DnsPrivateZonesOperations.get": "Oracle.Database.DnsPrivateZones.get", + "azure.mgmt.oracledatabase.operations.DnsPrivateZonesOperations.list_by_location": "Oracle.Database.DnsPrivateZones.listByLocation", + "azure.mgmt.oracledatabase.aio.operations.DnsPrivateZonesOperations.list_by_location": "Oracle.Database.DnsPrivateZones.listByLocation", + "azure.mgmt.oracledatabase.operations.FlexComponentsOperations.get": "Oracle.Database.FlexComponents.get", + "azure.mgmt.oracledatabase.aio.operations.FlexComponentsOperations.get": "Oracle.Database.FlexComponents.get", + "azure.mgmt.oracledatabase.operations.FlexComponentsOperations.list_by_parent": "Oracle.Database.FlexComponents.listByParent", + "azure.mgmt.oracledatabase.aio.operations.FlexComponentsOperations.list_by_parent": "Oracle.Database.FlexComponents.listByParent", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.list_by_subscription": "Azure.ResourceManager.AutonomousDatabases.listBySubscription", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.list_by_subscription": "Azure.ResourceManager.AutonomousDatabases.listBySubscription", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.begin_create_or_update": "Azure.ResourceManager.AutonomousDatabases.createOrUpdate", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.begin_create_or_update": "Azure.ResourceManager.AutonomousDatabases.createOrUpdate", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.get": "Azure.ResourceManager.AutonomousDatabases.get", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.get": "Azure.ResourceManager.AutonomousDatabases.get", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.begin_delete": "Azure.ResourceManager.AutonomousDatabases.delete", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.begin_delete": "Azure.ResourceManager.AutonomousDatabases.delete", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.begin_update": "Oracle.Database.AutonomousDatabases.update", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.begin_update": "Oracle.Database.AutonomousDatabases.update", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.list_by_resource_group": "Oracle.Database.AutonomousDatabases.listByResourceGroup", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.list_by_resource_group": "Oracle.Database.AutonomousDatabases.listByResourceGroup", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.begin_switchover": "Oracle.Database.AutonomousDatabases.switchover", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.begin_switchover": "Oracle.Database.AutonomousDatabases.switchover", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.begin_failover": "Oracle.Database.AutonomousDatabases.failover", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.begin_failover": "Oracle.Database.AutonomousDatabases.failover", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.generate_wallet": "Oracle.Database.AutonomousDatabases.generateWallet", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.generate_wallet": "Oracle.Database.AutonomousDatabases.generateWallet", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.begin_restore": "Oracle.Database.AutonomousDatabases.restore", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.begin_restore": "Oracle.Database.AutonomousDatabases.restore", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.begin_shrink": "Oracle.Database.AutonomousDatabases.shrink", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.begin_shrink": "Oracle.Database.AutonomousDatabases.shrink", + "azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations.begin_change_disaster_recovery_configuration": "Oracle.Database.AutonomousDatabases.changeDisasterRecoveryConfiguration", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations.begin_change_disaster_recovery_configuration": "Oracle.Database.AutonomousDatabases.changeDisasterRecoveryConfiguration", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseBackupsOperations.begin_create_or_update": "Azure.ResourceManager.AutonomousDatabaseBackups.createOrUpdate", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseBackupsOperations.begin_create_or_update": "Azure.ResourceManager.AutonomousDatabaseBackups.createOrUpdate", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseBackupsOperations.get": "Azure.ResourceManager.AutonomousDatabaseBackups.get", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseBackupsOperations.get": "Azure.ResourceManager.AutonomousDatabaseBackups.get", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseBackupsOperations.begin_delete": "Azure.ResourceManager.AutonomousDatabaseBackups.delete", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseBackupsOperations.begin_delete": "Azure.ResourceManager.AutonomousDatabaseBackups.delete", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseBackupsOperations.begin_update": "Oracle.Database.AutonomousDatabaseBackups.update", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseBackupsOperations.begin_update": "Oracle.Database.AutonomousDatabaseBackups.update", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseBackupsOperations.list_by_parent": "Oracle.Database.AutonomousDatabaseBackups.listByParent", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseBackupsOperations.list_by_parent": "Oracle.Database.AutonomousDatabaseBackups.listByParent", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseCharacterSetsOperations.get": "Oracle.Database.AutonomousDatabaseCharacterSets.get", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseCharacterSetsOperations.get": "Oracle.Database.AutonomousDatabaseCharacterSets.get", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseCharacterSetsOperations.list_by_location": "Oracle.Database.AutonomousDatabaseCharacterSets.listByLocation", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseCharacterSetsOperations.list_by_location": "Oracle.Database.AutonomousDatabaseCharacterSets.listByLocation", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseNationalCharacterSetsOperations.get": "Oracle.Database.AutonomousDatabaseNationalCharacterSets.get", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseNationalCharacterSetsOperations.get": "Oracle.Database.AutonomousDatabaseNationalCharacterSets.get", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseNationalCharacterSetsOperations.list_by_location": "Oracle.Database.AutonomousDatabaseNationalCharacterSets.listByLocation", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseNationalCharacterSetsOperations.list_by_location": "Oracle.Database.AutonomousDatabaseNationalCharacterSets.listByLocation", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseVersionsOperations.get": "Oracle.Database.AutonomousDatabaseVersions.get", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseVersionsOperations.get": "Oracle.Database.AutonomousDatabaseVersions.get", + "azure.mgmt.oracledatabase.operations.AutonomousDatabaseVersionsOperations.list_by_location": "Oracle.Database.AutonomousDatabaseVersions.listByLocation", + "azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseVersionsOperations.list_by_location": "Oracle.Database.AutonomousDatabaseVersions.listByLocation", + "azure.mgmt.oracledatabase.operations.ExadbVmClustersOperations.list_by_subscription": "Azure.ResourceManager.ExadbVmClusters.listBySubscription", + "azure.mgmt.oracledatabase.aio.operations.ExadbVmClustersOperations.list_by_subscription": "Azure.ResourceManager.ExadbVmClusters.listBySubscription", + "azure.mgmt.oracledatabase.operations.ExadbVmClustersOperations.begin_create_or_update": "Azure.ResourceManager.ExadbVmClusters.createOrUpdate", + "azure.mgmt.oracledatabase.aio.operations.ExadbVmClustersOperations.begin_create_or_update": "Azure.ResourceManager.ExadbVmClusters.createOrUpdate", + "azure.mgmt.oracledatabase.operations.ExadbVmClustersOperations.get": "Azure.ResourceManager.ExadbVmClusters.get", + "azure.mgmt.oracledatabase.aio.operations.ExadbVmClustersOperations.get": "Azure.ResourceManager.ExadbVmClusters.get", + "azure.mgmt.oracledatabase.operations.ExadbVmClustersOperations.begin_update": "Azure.ResourceManager.ExadbVmClusters.update", + "azure.mgmt.oracledatabase.aio.operations.ExadbVmClustersOperations.begin_update": "Azure.ResourceManager.ExadbVmClusters.update", + "azure.mgmt.oracledatabase.operations.ExadbVmClustersOperations.begin_delete": "Azure.ResourceManager.ExadbVmClusters.delete", + "azure.mgmt.oracledatabase.aio.operations.ExadbVmClustersOperations.begin_delete": "Azure.ResourceManager.ExadbVmClusters.delete", + "azure.mgmt.oracledatabase.operations.ExadbVmClustersOperations.list_by_resource_group": "Oracle.Database.ExadbVmClusters.listByResourceGroup", + "azure.mgmt.oracledatabase.aio.operations.ExadbVmClustersOperations.list_by_resource_group": "Oracle.Database.ExadbVmClusters.listByResourceGroup", + "azure.mgmt.oracledatabase.operations.ExadbVmClustersOperations.begin_remove_vms": "Oracle.Database.ExadbVmClusters.removeVms", + "azure.mgmt.oracledatabase.aio.operations.ExadbVmClustersOperations.begin_remove_vms": "Oracle.Database.ExadbVmClusters.removeVms", + "azure.mgmt.oracledatabase.operations.ExascaleDbNodesOperations.get": "Oracle.Database.ExascaleDbNodes.get", + "azure.mgmt.oracledatabase.aio.operations.ExascaleDbNodesOperations.get": "Oracle.Database.ExascaleDbNodes.get", + "azure.mgmt.oracledatabase.operations.ExascaleDbNodesOperations.list_by_parent": "Oracle.Database.ExascaleDbNodes.listByParent", + "azure.mgmt.oracledatabase.aio.operations.ExascaleDbNodesOperations.list_by_parent": "Oracle.Database.ExascaleDbNodes.listByParent", + "azure.mgmt.oracledatabase.operations.ExascaleDbNodesOperations.begin_action": "Oracle.Database.ExascaleDbNodes.action", + "azure.mgmt.oracledatabase.aio.operations.ExascaleDbNodesOperations.begin_action": "Oracle.Database.ExascaleDbNodes.action", + "azure.mgmt.oracledatabase.operations.ExascaleDbStorageVaultsOperations.get": "Oracle.Database.ExascaleDbStorageVaults.get", + "azure.mgmt.oracledatabase.aio.operations.ExascaleDbStorageVaultsOperations.get": "Oracle.Database.ExascaleDbStorageVaults.get", + "azure.mgmt.oracledatabase.operations.ExascaleDbStorageVaultsOperations.begin_create": "Oracle.Database.ExascaleDbStorageVaults.create", + "azure.mgmt.oracledatabase.aio.operations.ExascaleDbStorageVaultsOperations.begin_create": "Oracle.Database.ExascaleDbStorageVaults.create", + "azure.mgmt.oracledatabase.operations.ExascaleDbStorageVaultsOperations.begin_update": "Oracle.Database.ExascaleDbStorageVaults.update", + "azure.mgmt.oracledatabase.aio.operations.ExascaleDbStorageVaultsOperations.begin_update": "Oracle.Database.ExascaleDbStorageVaults.update", + "azure.mgmt.oracledatabase.operations.ExascaleDbStorageVaultsOperations.begin_delete": "Oracle.Database.ExascaleDbStorageVaults.delete", + "azure.mgmt.oracledatabase.aio.operations.ExascaleDbStorageVaultsOperations.begin_delete": "Oracle.Database.ExascaleDbStorageVaults.delete", + "azure.mgmt.oracledatabase.operations.ExascaleDbStorageVaultsOperations.list_by_resource_group": "Oracle.Database.ExascaleDbStorageVaults.listByResourceGroup", + "azure.mgmt.oracledatabase.aio.operations.ExascaleDbStorageVaultsOperations.list_by_resource_group": "Oracle.Database.ExascaleDbStorageVaults.listByResourceGroup", + "azure.mgmt.oracledatabase.operations.ExascaleDbStorageVaultsOperations.list_by_subscription": "Oracle.Database.ExascaleDbStorageVaults.listBySubscription", + "azure.mgmt.oracledatabase.aio.operations.ExascaleDbStorageVaultsOperations.list_by_subscription": "Oracle.Database.ExascaleDbStorageVaults.listBySubscription" + } +} \ No newline at end of file diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/assets.json b/sdk/oracledatabase/azure-mgmt-oracledatabase/assets.json deleted file mode 100644 index 950b87368dd7..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "python", - "TagPrefix": "python/oracledatabase/azure-mgmt-oracledatabase", - "Tag": "python/oracledatabase/azure-mgmt-oracledatabase_ffd81034f0" -} diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/__init__.py index d771d453e326..eef02e7400a7 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/__init__.py @@ -2,18 +2,24 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._oracle_database_mgmt_client import OracleDatabaseMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import OracleDatabaseMgmtClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "OracleDatabaseMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_oracle_database_mgmt_client.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_client.py similarity index 71% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_oracle_database_mgmt_client.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_client.py index 868640f5c6e8..8c772ec6a15c 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_oracle_database_mgmt_client.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_client.py @@ -2,21 +2,23 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +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 ._configuration import OracleDatabaseMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( AutonomousDatabaseBackupsOperations, AutonomousDatabaseCharacterSetsOperations, @@ -30,7 +32,13 @@ DbSystemShapesOperations, DnsPrivateViewsOperations, DnsPrivateZonesOperations, + ExadbVmClustersOperations, + ExascaleDbNodesOperations, + ExascaleDbStorageVaultsOperations, + FlexComponentsOperations, + GiMinorVersionsOperations, GiVersionsOperations, + ListActionsOperations, Operations, OracleSubscriptionsOperations, SystemVersionsOperations, @@ -38,23 +46,51 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class OracleDatabaseMgmtClient: # pylint: disable=too-many-instance-attributes """OracleDatabaseMgmtClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.oracledatabase.operations.Operations - :ivar autonomous_databases: AutonomousDatabasesOperations operations - :vartype autonomous_databases: - azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations :ivar cloud_exadata_infrastructures: CloudExadataInfrastructuresOperations operations :vartype cloud_exadata_infrastructures: azure.mgmt.oracledatabase.operations.CloudExadataInfrastructuresOperations + :ivar list_actions: ListActionsOperations operations + :vartype list_actions: azure.mgmt.oracledatabase.operations.ListActionsOperations + :ivar db_servers: DbServersOperations operations + :vartype db_servers: azure.mgmt.oracledatabase.operations.DbServersOperations :ivar cloud_vm_clusters: CloudVmClustersOperations operations :vartype cloud_vm_clusters: azure.mgmt.oracledatabase.operations.CloudVmClustersOperations + :ivar virtual_network_addresses: VirtualNetworkAddressesOperations operations + :vartype virtual_network_addresses: + azure.mgmt.oracledatabase.operations.VirtualNetworkAddressesOperations + :ivar system_versions: SystemVersionsOperations operations + :vartype system_versions: azure.mgmt.oracledatabase.operations.SystemVersionsOperations + :ivar oracle_subscriptions: OracleSubscriptionsOperations operations + :vartype oracle_subscriptions: + azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations + :ivar db_nodes: DbNodesOperations operations + :vartype db_nodes: azure.mgmt.oracledatabase.operations.DbNodesOperations + :ivar gi_versions: GiVersionsOperations operations + :vartype gi_versions: azure.mgmt.oracledatabase.operations.GiVersionsOperations + :ivar gi_minor_versions: GiMinorVersionsOperations operations + :vartype gi_minor_versions: azure.mgmt.oracledatabase.operations.GiMinorVersionsOperations + :ivar db_system_shapes: DbSystemShapesOperations operations + :vartype db_system_shapes: azure.mgmt.oracledatabase.operations.DbSystemShapesOperations + :ivar dns_private_views: DnsPrivateViewsOperations operations + :vartype dns_private_views: azure.mgmt.oracledatabase.operations.DnsPrivateViewsOperations + :ivar dns_private_zones: DnsPrivateZonesOperations operations + :vartype dns_private_zones: azure.mgmt.oracledatabase.operations.DnsPrivateZonesOperations + :ivar flex_components: FlexComponentsOperations operations + :vartype flex_components: azure.mgmt.oracledatabase.operations.FlexComponentsOperations + :ivar autonomous_databases: AutonomousDatabasesOperations operations + :vartype autonomous_databases: + azure.mgmt.oracledatabase.operations.AutonomousDatabasesOperations + :ivar autonomous_database_backups: AutonomousDatabaseBackupsOperations operations + :vartype autonomous_database_backups: + azure.mgmt.oracledatabase.operations.AutonomousDatabaseBackupsOperations :ivar autonomous_database_character_sets: AutonomousDatabaseCharacterSetsOperations operations :vartype autonomous_database_character_sets: azure.mgmt.oracledatabase.operations.AutonomousDatabaseCharacterSetsOperations @@ -65,52 +101,43 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke :ivar autonomous_database_versions: AutonomousDatabaseVersionsOperations operations :vartype autonomous_database_versions: azure.mgmt.oracledatabase.operations.AutonomousDatabaseVersionsOperations - :ivar db_system_shapes: DbSystemShapesOperations operations - :vartype db_system_shapes: azure.mgmt.oracledatabase.operations.DbSystemShapesOperations - :ivar dns_private_views: DnsPrivateViewsOperations operations - :vartype dns_private_views: azure.mgmt.oracledatabase.operations.DnsPrivateViewsOperations - :ivar dns_private_zones: DnsPrivateZonesOperations operations - :vartype dns_private_zones: azure.mgmt.oracledatabase.operations.DnsPrivateZonesOperations - :ivar gi_versions: GiVersionsOperations operations - :vartype gi_versions: azure.mgmt.oracledatabase.operations.GiVersionsOperations - :ivar system_versions: SystemVersionsOperations operations - :vartype system_versions: azure.mgmt.oracledatabase.operations.SystemVersionsOperations - :ivar oracle_subscriptions: OracleSubscriptionsOperations operations - :vartype oracle_subscriptions: - azure.mgmt.oracledatabase.operations.OracleSubscriptionsOperations - :ivar autonomous_database_backups: AutonomousDatabaseBackupsOperations operations - :vartype autonomous_database_backups: - azure.mgmt.oracledatabase.operations.AutonomousDatabaseBackupsOperations - :ivar db_servers: DbServersOperations operations - :vartype db_servers: azure.mgmt.oracledatabase.operations.DbServersOperations - :ivar db_nodes: DbNodesOperations operations - :vartype db_nodes: azure.mgmt.oracledatabase.operations.DbNodesOperations - :ivar virtual_network_addresses: VirtualNetworkAddressesOperations operations - :vartype virtual_network_addresses: - azure.mgmt.oracledatabase.operations.VirtualNetworkAddressesOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar exadb_vm_clusters: ExadbVmClustersOperations operations + :vartype exadb_vm_clusters: azure.mgmt.oracledatabase.operations.ExadbVmClustersOperations + :ivar exascale_db_nodes: ExascaleDbNodesOperations operations + :vartype exascale_db_nodes: azure.mgmt.oracledatabase.operations.ExascaleDbNodesOperations + :ivar exascale_db_storage_vaults: ExascaleDbStorageVaultsOperations operations + :vartype exascale_db_storage_vaults: + azure.mgmt.oracledatabase.operations.ExascaleDbStorageVaultsOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is "2025-03-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" + _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 = OracleDatabaseMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -129,29 +156,30 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), 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 = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.autonomous_databases = AutonomousDatabasesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.cloud_exadata_infrastructures = CloudExadataInfrastructuresOperations( self._client, self._config, self._serialize, self._deserialize ) + self.list_actions = ListActionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.db_servers = DbServersOperations(self._client, self._config, self._serialize, self._deserialize) self.cloud_vm_clusters = CloudVmClustersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.autonomous_database_character_sets = AutonomousDatabaseCharacterSetsOperations( + self.virtual_network_addresses = VirtualNetworkAddressesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.autonomous_database_national_character_sets = AutonomousDatabaseNationalCharacterSetsOperations( + self.system_versions = SystemVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.oracle_subscriptions = OracleSubscriptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.autonomous_database_versions = AutonomousDatabaseVersionsOperations( + self.db_nodes = DbNodesOperations(self._client, self._config, self._serialize, self._deserialize) + self.gi_versions = GiVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.gi_minor_versions = GiMinorVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) self.db_system_shapes = DbSystemShapesOperations(self._client, self._config, self._serialize, self._deserialize) @@ -161,27 +189,39 @@ def __init__( self.dns_private_zones = DnsPrivateZonesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.gi_versions = GiVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.system_versions = SystemVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.oracle_subscriptions = OracleSubscriptionsOperations( + self.flex_components = FlexComponentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.autonomous_databases = AutonomousDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) self.autonomous_database_backups = AutonomousDatabaseBackupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.db_servers = DbServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.db_nodes = DbNodesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_addresses = VirtualNetworkAddressesOperations( + self.autonomous_database_character_sets = AutonomousDatabaseCharacterSetsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.autonomous_database_national_character_sets = AutonomousDatabaseNationalCharacterSetsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.autonomous_database_versions = AutonomousDatabaseVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.exadb_vm_clusters = ExadbVmClustersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.exascale_db_nodes = ExascaleDbNodesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.exascale_db_storage_vaults = ExascaleDbStorageVaultsOperations( self._client, self._config, self._serialize, self._deserialize ) - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + 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) + >>> response = client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -194,13 +234,17 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() - def __enter__(self) -> "OracleDatabaseMgmtClient": + def __enter__(self) -> Self: self._client.__enter__() return self diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_configuration.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_configuration.py index 8ea73084e943..bdf1c6c7e2e0 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_configuration.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -14,27 +14,34 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for OracleDatabaseMgmtClient. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is "2025-03-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", "2023-09-01") + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2025-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -43,6 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-oracledatabase/{}".format(VERSION)) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_patch.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_patch.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_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/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_vendor.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/__init__.py similarity index 50% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_vendor.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/__init__.py index 0dafe0e287ff..8026245c2abc 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_vendor.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/__init__.py @@ -1,16 +1,6 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/model_base.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/model_base.py new file mode 100644 index 000000000000..49d5c7259389 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/model_base.py @@ -0,0 +1,1232 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field( + attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str +) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: typing.Set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: typing.Dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: typing.List[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + if annotation._name == "Dict": # pyright: ignore + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value) + except ValueError: + # for unknown value, return raw value + return value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + value: typing.Any, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, value) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + + @property + def _class_type(self) -> typing.Any: + return getattr(self._type, "args", [None])[0] + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + item = obj.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + return _deserialize(self._type, _serialize(item, self._format), rf=self) + + def __set__(self, obj: Model, value) -> None: + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, typing.List[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[typing.Dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element(tag, prefix=None, ns=None): + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: typing.Dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: typing.List[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_serialization.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/serialization.py similarity index 83% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_serialization.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/serialization.py index f0c6180722c8..eb86ea23c965 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_serialization.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/serialization.py @@ -1,30 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -48,11 +30,8 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, - Mapping, ) try: @@ -62,13 +41,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -91,6 +70,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +93,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -144,6 +125,8 @@ def _json_attemp(data): # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod @@ -153,6 +136,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -177,80 +165,31 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0.""" - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation.""" - return "Z" - - def dst(self, dt): - """No daylight saving for UTC.""" - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? None: self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -298,13 +244,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -324,7 +280,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -344,7 +304,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, @@ -378,12 +340,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -393,30 +358,31 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -424,9 +390,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -446,21 +414,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -499,11 +471,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -538,7 +512,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -558,13 +532,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -590,12 +567,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": @@ -631,7 +610,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -662,17 +642,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -701,7 +681,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -710,11 +690,13 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -726,21 +708,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :keyword bool skip_quote: Whether to skip quote the serialized result. - Defaults to False. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -757,19 +738,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -778,21 +760,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -803,7 +784,7 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class @@ -819,11 +800,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -839,23 +819,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -869,8 +852,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -880,15 +862,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. Defaults to False. :rtype: list, str + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -943,9 +923,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -969,7 +948,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -977,6 +956,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1001,7 +981,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1032,56 +1012,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1089,11 +1074,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1103,30 +1089,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1139,12 +1127,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1170,13 +1159,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1184,11 +1174,11 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data @@ -1209,7 +1199,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1230,17 +1222,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1277,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1329,22 +1333,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1352,7 +1355,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1361,9 +1364,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1399,27 +1402,29 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1438,13 +1443,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1474,9 +1479,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1503,6 +1507,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1514,7 +1520,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1529,10 +1535,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1550,10 +1558,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1577,24 +1587,35 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1603,15 +1624,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1625,7 +1647,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1645,14 +1671,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1669,6 +1695,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1679,13 +1706,14 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1718,11 +1746,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1730,8 +1757,9 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1741,24 +1769,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1766,6 +1793,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1779,8 +1807,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1792,6 +1819,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1802,9 +1830,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1820,8 +1848,9 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1832,8 +1861,9 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1847,8 +1877,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal - :raises: DeserializationError if string format invalid. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1863,8 +1894,9 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1875,8 +1907,9 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1885,16 +1918,16 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1908,8 +1941,9 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1922,31 +1956,32 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1974,8 +2009,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1983,8 +2017,9 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore @@ -1994,5 +2029,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_validation.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_validation.py new file mode 100644 index 000000000000..752b2822f9d3 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_validation.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if method_added_on > client_api_version: + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and api_version > client_api_version + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_version.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_version.py index c47f66669f1b..8f2350dd3b0c 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_version.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_version.py @@ -2,8 +2,8 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "2.0.0" diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/__init__.py index 6439ec348295..d03d7ba95c49 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/__init__.py @@ -2,15 +2,21 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._oracle_database_mgmt_client import OracleDatabaseMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import OracleDatabaseMgmtClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "OracleDatabaseMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_oracle_database_mgmt_client.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_client.py similarity index 71% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_oracle_database_mgmt_client.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_client.py index 9fd6887a3098..bab37dc2b1c6 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_oracle_database_mgmt_client.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_client.py @@ -2,20 +2,22 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +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 .._utils.serialization import Deserializer, Serializer from ._configuration import OracleDatabaseMgmtClientConfiguration from .operations import ( AutonomousDatabaseBackupsOperations, @@ -30,7 +32,13 @@ DbSystemShapesOperations, DnsPrivateViewsOperations, DnsPrivateZonesOperations, + ExadbVmClustersOperations, + ExascaleDbNodesOperations, + ExascaleDbStorageVaultsOperations, + FlexComponentsOperations, + GiMinorVersionsOperations, GiVersionsOperations, + ListActionsOperations, Operations, OracleSubscriptionsOperations, SystemVersionsOperations, @@ -38,23 +46,51 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class OracleDatabaseMgmtClient: # pylint: disable=too-many-instance-attributes """OracleDatabaseMgmtClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.oracledatabase.aio.operations.Operations - :ivar autonomous_databases: AutonomousDatabasesOperations operations - :vartype autonomous_databases: - azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations :ivar cloud_exadata_infrastructures: CloudExadataInfrastructuresOperations operations :vartype cloud_exadata_infrastructures: azure.mgmt.oracledatabase.aio.operations.CloudExadataInfrastructuresOperations + :ivar list_actions: ListActionsOperations operations + :vartype list_actions: azure.mgmt.oracledatabase.aio.operations.ListActionsOperations + :ivar db_servers: DbServersOperations operations + :vartype db_servers: azure.mgmt.oracledatabase.aio.operations.DbServersOperations :ivar cloud_vm_clusters: CloudVmClustersOperations operations :vartype cloud_vm_clusters: azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations + :ivar virtual_network_addresses: VirtualNetworkAddressesOperations operations + :vartype virtual_network_addresses: + azure.mgmt.oracledatabase.aio.operations.VirtualNetworkAddressesOperations + :ivar system_versions: SystemVersionsOperations operations + :vartype system_versions: azure.mgmt.oracledatabase.aio.operations.SystemVersionsOperations + :ivar oracle_subscriptions: OracleSubscriptionsOperations operations + :vartype oracle_subscriptions: + azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations + :ivar db_nodes: DbNodesOperations operations + :vartype db_nodes: azure.mgmt.oracledatabase.aio.operations.DbNodesOperations + :ivar gi_versions: GiVersionsOperations operations + :vartype gi_versions: azure.mgmt.oracledatabase.aio.operations.GiVersionsOperations + :ivar gi_minor_versions: GiMinorVersionsOperations operations + :vartype gi_minor_versions: azure.mgmt.oracledatabase.aio.operations.GiMinorVersionsOperations + :ivar db_system_shapes: DbSystemShapesOperations operations + :vartype db_system_shapes: azure.mgmt.oracledatabase.aio.operations.DbSystemShapesOperations + :ivar dns_private_views: DnsPrivateViewsOperations operations + :vartype dns_private_views: azure.mgmt.oracledatabase.aio.operations.DnsPrivateViewsOperations + :ivar dns_private_zones: DnsPrivateZonesOperations operations + :vartype dns_private_zones: azure.mgmt.oracledatabase.aio.operations.DnsPrivateZonesOperations + :ivar flex_components: FlexComponentsOperations operations + :vartype flex_components: azure.mgmt.oracledatabase.aio.operations.FlexComponentsOperations + :ivar autonomous_databases: AutonomousDatabasesOperations operations + :vartype autonomous_databases: + azure.mgmt.oracledatabase.aio.operations.AutonomousDatabasesOperations + :ivar autonomous_database_backups: AutonomousDatabaseBackupsOperations operations + :vartype autonomous_database_backups: + azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseBackupsOperations :ivar autonomous_database_character_sets: AutonomousDatabaseCharacterSetsOperations operations :vartype autonomous_database_character_sets: azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseCharacterSetsOperations @@ -65,52 +101,43 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke :ivar autonomous_database_versions: AutonomousDatabaseVersionsOperations operations :vartype autonomous_database_versions: azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseVersionsOperations - :ivar db_system_shapes: DbSystemShapesOperations operations - :vartype db_system_shapes: azure.mgmt.oracledatabase.aio.operations.DbSystemShapesOperations - :ivar dns_private_views: DnsPrivateViewsOperations operations - :vartype dns_private_views: azure.mgmt.oracledatabase.aio.operations.DnsPrivateViewsOperations - :ivar dns_private_zones: DnsPrivateZonesOperations operations - :vartype dns_private_zones: azure.mgmt.oracledatabase.aio.operations.DnsPrivateZonesOperations - :ivar gi_versions: GiVersionsOperations operations - :vartype gi_versions: azure.mgmt.oracledatabase.aio.operations.GiVersionsOperations - :ivar system_versions: SystemVersionsOperations operations - :vartype system_versions: azure.mgmt.oracledatabase.aio.operations.SystemVersionsOperations - :ivar oracle_subscriptions: OracleSubscriptionsOperations operations - :vartype oracle_subscriptions: - azure.mgmt.oracledatabase.aio.operations.OracleSubscriptionsOperations - :ivar autonomous_database_backups: AutonomousDatabaseBackupsOperations operations - :vartype autonomous_database_backups: - azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseBackupsOperations - :ivar db_servers: DbServersOperations operations - :vartype db_servers: azure.mgmt.oracledatabase.aio.operations.DbServersOperations - :ivar db_nodes: DbNodesOperations operations - :vartype db_nodes: azure.mgmt.oracledatabase.aio.operations.DbNodesOperations - :ivar virtual_network_addresses: VirtualNetworkAddressesOperations operations - :vartype virtual_network_addresses: - azure.mgmt.oracledatabase.aio.operations.VirtualNetworkAddressesOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar exadb_vm_clusters: ExadbVmClustersOperations operations + :vartype exadb_vm_clusters: azure.mgmt.oracledatabase.aio.operations.ExadbVmClustersOperations + :ivar exascale_db_nodes: ExascaleDbNodesOperations operations + :vartype exascale_db_nodes: azure.mgmt.oracledatabase.aio.operations.ExascaleDbNodesOperations + :ivar exascale_db_storage_vaults: ExascaleDbStorageVaultsOperations operations + :vartype exascale_db_storage_vaults: + azure.mgmt.oracledatabase.aio.operations.ExascaleDbStorageVaultsOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Default value is "2025-03-01". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" + _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 = OracleDatabaseMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -129,29 +156,32 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), 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 = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.autonomous_databases = AutonomousDatabasesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.cloud_exadata_infrastructures = CloudExadataInfrastructuresOperations( self._client, self._config, self._serialize, self._deserialize ) + self.list_actions = ListActionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.db_servers = DbServersOperations(self._client, self._config, self._serialize, self._deserialize) self.cloud_vm_clusters = CloudVmClustersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.autonomous_database_character_sets = AutonomousDatabaseCharacterSetsOperations( + self.virtual_network_addresses = VirtualNetworkAddressesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.autonomous_database_national_character_sets = AutonomousDatabaseNationalCharacterSetsOperations( + self.system_versions = SystemVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.oracle_subscriptions = OracleSubscriptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.autonomous_database_versions = AutonomousDatabaseVersionsOperations( + self.db_nodes = DbNodesOperations(self._client, self._config, self._serialize, self._deserialize) + self.gi_versions = GiVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.gi_minor_versions = GiMinorVersionsOperations( self._client, self._config, self._serialize, self._deserialize ) self.db_system_shapes = DbSystemShapesOperations(self._client, self._config, self._serialize, self._deserialize) @@ -161,21 +191,33 @@ def __init__( self.dns_private_zones = DnsPrivateZonesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.gi_versions = GiVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.system_versions = SystemVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.oracle_subscriptions = OracleSubscriptionsOperations( + self.flex_components = FlexComponentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.autonomous_databases = AutonomousDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) self.autonomous_database_backups = AutonomousDatabaseBackupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.db_servers = DbServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.db_nodes = DbNodesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_addresses = VirtualNetworkAddressesOperations( + self.autonomous_database_character_sets = AutonomousDatabaseCharacterSetsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.autonomous_database_national_character_sets = AutonomousDatabaseNationalCharacterSetsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.autonomous_database_versions = AutonomousDatabaseVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.exadb_vm_clusters = ExadbVmClustersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.exascale_db_nodes = ExascaleDbNodesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.exascale_db_storage_vaults = ExascaleDbStorageVaultsOperations( self._client, self._config, self._serialize, self._deserialize ) - def _send_request( + def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -183,7 +225,7 @@ def _send_request( >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client._send_request(request) + >>> response = await client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -196,13 +238,17 @@ def _send_request( """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "OracleDatabaseMgmtClient": + async def __aenter__(self) -> Self: await self._client.__aenter__() return self diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_configuration.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_configuration.py index 1b748e31fdd6..70d44be48177 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_configuration.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -14,27 +14,34 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for OracleDatabaseMgmtClient. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is "2025-03-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", "2023-09-01") + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2025-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -43,6 +50,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-oracledatabase/{}".format(VERSION)) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_patch.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_patch.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/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/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/__init__.py index 6cd78dc91ca1..f84dee0a8172 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/__init__.py @@ -2,50 +2,68 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._autonomous_databases_operations import AutonomousDatabasesOperations -from ._cloud_exadata_infrastructures_operations import CloudExadataInfrastructuresOperations -from ._cloud_vm_clusters_operations import CloudVmClustersOperations -from ._autonomous_database_character_sets_operations import AutonomousDatabaseCharacterSetsOperations -from ._autonomous_database_national_character_sets_operations import AutonomousDatabaseNationalCharacterSetsOperations -from ._autonomous_database_versions_operations import AutonomousDatabaseVersionsOperations -from ._db_system_shapes_operations import DbSystemShapesOperations -from ._dns_private_views_operations import DnsPrivateViewsOperations -from ._dns_private_zones_operations import DnsPrivateZonesOperations -from ._gi_versions_operations import GiVersionsOperations -from ._system_versions_operations import SystemVersionsOperations -from ._oracle_subscriptions_operations import OracleSubscriptionsOperations -from ._autonomous_database_backups_operations import AutonomousDatabaseBackupsOperations -from ._db_servers_operations import DbServersOperations -from ._db_nodes_operations import DbNodesOperations -from ._virtual_network_addresses_operations import VirtualNetworkAddressesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import CloudExadataInfrastructuresOperations # type: ignore +from ._operations import ListActionsOperations # type: ignore +from ._operations import DbServersOperations # type: ignore +from ._operations import CloudVmClustersOperations # type: ignore +from ._operations import VirtualNetworkAddressesOperations # type: ignore +from ._operations import SystemVersionsOperations # type: ignore +from ._operations import OracleSubscriptionsOperations # type: ignore +from ._operations import DbNodesOperations # type: ignore +from ._operations import GiVersionsOperations # type: ignore +from ._operations import GiMinorVersionsOperations # type: ignore +from ._operations import DbSystemShapesOperations # type: ignore +from ._operations import DnsPrivateViewsOperations # type: ignore +from ._operations import DnsPrivateZonesOperations # type: ignore +from ._operations import FlexComponentsOperations # type: ignore +from ._operations import AutonomousDatabasesOperations # type: ignore +from ._operations import AutonomousDatabaseBackupsOperations # type: ignore +from ._operations import AutonomousDatabaseCharacterSetsOperations # type: ignore +from ._operations import AutonomousDatabaseNationalCharacterSetsOperations # type: ignore +from ._operations import AutonomousDatabaseVersionsOperations # type: ignore +from ._operations import ExadbVmClustersOperations # type: ignore +from ._operations import ExascaleDbNodesOperations # type: ignore +from ._operations import ExascaleDbStorageVaultsOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "Operations", - "AutonomousDatabasesOperations", "CloudExadataInfrastructuresOperations", + "ListActionsOperations", + "DbServersOperations", "CloudVmClustersOperations", - "AutonomousDatabaseCharacterSetsOperations", - "AutonomousDatabaseNationalCharacterSetsOperations", - "AutonomousDatabaseVersionsOperations", + "VirtualNetworkAddressesOperations", + "SystemVersionsOperations", + "OracleSubscriptionsOperations", + "DbNodesOperations", + "GiVersionsOperations", + "GiMinorVersionsOperations", "DbSystemShapesOperations", "DnsPrivateViewsOperations", "DnsPrivateZonesOperations", - "GiVersionsOperations", - "SystemVersionsOperations", - "OracleSubscriptionsOperations", + "FlexComponentsOperations", + "AutonomousDatabasesOperations", "AutonomousDatabaseBackupsOperations", - "DbServersOperations", - "DbNodesOperations", - "VirtualNetworkAddressesOperations", + "AutonomousDatabaseCharacterSetsOperations", + "AutonomousDatabaseNationalCharacterSetsOperations", + "AutonomousDatabaseVersionsOperations", + "ExadbVmClustersOperations", + "ExascaleDbNodesOperations", + "ExascaleDbStorageVaultsOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_backups_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_backups_operations.py deleted file mode 100644 index c156a1fe6e40..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_backups_operations.py +++ /dev/null @@ -1,751 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._autonomous_database_backups_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_autonomous_database_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AutonomousDatabaseBackupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`autonomous_database_backups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_autonomous_database( - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> AsyncIterable["_models.AutonomousDatabaseBackup"]: - """List AutonomousDatabaseBackup resources by AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :return: An iterator like instance of either AutonomousDatabaseBackup or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_autonomous_database_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseBackupListResult", 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( - self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any - ) -> _models.AutonomousDatabaseBackup: - """Get a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :return: AutonomousDatabaseBackup or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabaseBackup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - resource: Union[_models.AutonomousDatabaseBackup, IO[bytes]], - **kwargs: Any - ) -> _models.AutonomousDatabaseBackup: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "AutonomousDatabaseBackup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - resource: _models.AutonomousDatabaseBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: - """Create a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup - :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 AutonomousDatabaseBackup or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: - """Create a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either AutonomousDatabaseBackup or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - resource: Union[_models.AutonomousDatabaseBackup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: - """Create a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param resource: Resource create parameters. Is either a AutonomousDatabaseBackup type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup or IO[bytes] - :return: An instance of AsyncLROPoller that returns either AutonomousDatabaseBackup or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabaseBackup] = 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, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AutonomousDatabaseBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AutonomousDatabaseBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - properties: Union[_models.AutonomousDatabaseBackupUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabaseBackup]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabaseBackup]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "AutonomousDatabaseBackupUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - properties: _models.AutonomousDatabaseBackupUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: - """Update a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdate - :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 AutonomousDatabaseBackup or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: - """Update a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 AutonomousDatabaseBackup or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - properties: Union[_models.AutonomousDatabaseBackupUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: - """Update a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param properties: The resource properties to be updated. Is either a - AutonomousDatabaseBackupUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either AutonomousDatabaseBackup or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AutonomousDatabaseBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AutonomousDatabaseBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_character_sets_operations.py deleted file mode 100644 index fbef63286512..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_character_sets_operations.py +++ /dev/null @@ -1,200 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._autonomous_database_character_sets_operations import ( - build_get_request, - build_list_by_location_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AutonomousDatabaseCharacterSetsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`autonomous_database_character_sets` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AutonomousDatabaseCharacterSet"]: - """List AutonomousDatabaseCharacterSet resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either AutonomousDatabaseCharacterSet or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseCharacterSetListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseCharacterSetListResult", 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(self, location: str, adbscharsetname: str, **kwargs: Any) -> _models.AutonomousDatabaseCharacterSet: - """Get a AutonomousDatabaseCharacterSet. - - :param location: The name of the Azure region. Required. - :type location: str - :param adbscharsetname: AutonomousDatabaseCharacterSet name. Required. - :type adbscharsetname: str - :return: AutonomousDatabaseCharacterSet or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseCharacterSet] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - adbscharsetname=adbscharsetname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabaseCharacterSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_national_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_national_character_sets_operations.py deleted file mode 100644 index 2d8c1fc08ab2..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_national_character_sets_operations.py +++ /dev/null @@ -1,204 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._autonomous_database_national_character_sets_operations import ( - build_get_request, - build_list_by_location_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AutonomousDatabaseNationalCharacterSetsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`autonomous_database_national_character_sets` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, location: str, **kwargs: Any - ) -> AsyncIterable["_models.AutonomousDatabaseNationalCharacterSet"]: - """List AutonomousDatabaseNationalCharacterSet resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either AutonomousDatabaseNationalCharacterSet or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseNationalCharacterSetListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseNationalCharacterSetListResult", 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( - self, location: str, adbsncharsetname: str, **kwargs: Any - ) -> _models.AutonomousDatabaseNationalCharacterSet: - """Get a AutonomousDatabaseNationalCharacterSet. - - :param location: The name of the Azure region. Required. - :type location: str - :param adbsncharsetname: AutonomousDatabaseNationalCharacterSets name. Required. - :type adbsncharsetname: str - :return: AutonomousDatabaseNationalCharacterSet or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseNationalCharacterSet] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - adbsncharsetname=adbsncharsetname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabaseNationalCharacterSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_versions_operations.py deleted file mode 100644 index 675b6181b104..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_versions_operations.py +++ /dev/null @@ -1,196 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._autonomous_database_versions_operations import build_get_request, build_list_by_location_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AutonomousDatabaseVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`autonomous_database_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AutonomousDbVersion"]: - """List AutonomousDbVersion resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either AutonomousDbVersion or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDbVersionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDbVersionListResult", 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(self, location: str, autonomousdbversionsname: str, **kwargs: Any) -> _models.AutonomousDbVersion: - """Get a AutonomousDbVersion. - - :param location: The name of the Azure region. Required. - :type location: str - :param autonomousdbversionsname: AutonomousDbVersion name. Required. - :type autonomousdbversionsname: str - :return: AutonomousDbVersion or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDbVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDbVersion] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - autonomousdbversionsname=autonomousdbversionsname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDbVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_databases_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_databases_operations.py deleted file mode 100644 index d37a1ca09bb8..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_databases_operations.py +++ /dev/null @@ -1,1650 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._autonomous_databases_operations import ( - build_create_or_update_request, - build_delete_request, - build_failover_request, - build_generate_wallet_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_restore_request, - build_shrink_request, - build_switchover_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AutonomousDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`autonomous_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.AutonomousDatabase"]: - """List AutonomousDatabase resources by subscription ID. - - :return: An iterator like instance of either AutonomousDatabase or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseListResult", 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.AutonomousDatabase"]: - """List AutonomousDatabase resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either AutonomousDatabase or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_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 = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseListResult", 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( - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> _models.AutonomousDatabase: - """Get a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :return: AutonomousDatabase or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabase", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - resource: Union[_models.AutonomousDatabase, IO[bytes]], - **kwargs: Any - ) -> _models.AutonomousDatabase: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "AutonomousDatabase") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - resource: _models.AutonomousDatabase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Create a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabase - :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 AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Create a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - resource: Union[_models.AutonomousDatabase, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Create a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param resource: Resource create parameters. Is either a AutonomousDatabase type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabase or IO[bytes] - :return: An instance of AsyncLROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = 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, - autonomousdatabasename=autonomousdatabasename, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - properties: Union[_models.AutonomousDatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "AutonomousDatabaseUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - properties: _models.AutonomousDatabaseUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Update a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdate - :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 AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Update a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - properties: Union[_models.AutonomousDatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Update a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param properties: The resource properties to be updated. Is either a AutonomousDatabaseUpdate - type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _failover_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.PeerDbDetails, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "PeerDbDetails") - - _request = build_failover_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_failover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: _models.PeerDbDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Perform failover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails - :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 AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_failover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Perform failover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: 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 AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_failover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.PeerDbDetails, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Perform failover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Is either a PeerDbDetails type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails or IO[bytes] - :return: An instance of AsyncLROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = 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._failover_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def generate_wallet( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: _models.GenerateAutonomousDatabaseWalletDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AutonomousDatabaseWalletFile: - """Generate wallet action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.GenerateAutonomousDatabaseWalletDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AutonomousDatabaseWalletFile or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def generate_wallet( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AutonomousDatabaseWalletFile: - """Generate wallet action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: 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: AutonomousDatabaseWalletFile or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def generate_wallet( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.GenerateAutonomousDatabaseWalletDetails, IO[bytes]], - **kwargs: Any - ) -> _models.AutonomousDatabaseWalletFile: - """Generate wallet action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Is either a - GenerateAutonomousDatabaseWalletDetails type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.oracledatabase.models.GenerateAutonomousDatabaseWalletDetails or - IO[bytes] - :return: AutonomousDatabaseWalletFile or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabaseWalletFile] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "GenerateAutonomousDatabaseWalletDetails") - - _request = build_generate_wallet_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabaseWalletFile", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _restore_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.RestoreAutonomousDatabaseDetails, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "RestoreAutonomousDatabaseDetails") - - _request = build_restore_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_restore( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: _models.RestoreAutonomousDatabaseDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Restores an Autonomous Database based on the provided request parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.RestoreAutonomousDatabaseDetails - :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 AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_restore( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Restores an Autonomous Database based on the provided request parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: 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 AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_restore( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.RestoreAutonomousDatabaseDetails, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Restores an Autonomous Database based on the provided request parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Is either a RestoreAutonomousDatabaseDetails - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.oracledatabase.models.RestoreAutonomousDatabaseDetails or IO[bytes] - :return: An instance of AsyncLROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = 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._restore_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _shrink_initial( - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - _request = build_shrink_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_shrink( - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """This operation shrinks the current allocated storage down to the current actual used data - storage. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :return: An instance of AsyncLROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabase] = 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._shrink_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _switchover_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.PeerDbDetails, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "PeerDbDetails") - - _request = build_switchover_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_switchover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: _models.PeerDbDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Perform switchover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails - :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 AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_switchover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Perform switchover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: 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 AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_switchover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.PeerDbDetails, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.AutonomousDatabase]: - """Perform switchover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Is either a PeerDbDetails type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails or IO[bytes] - :return: An instance of AsyncLROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = 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._switchover_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_exadata_infrastructures_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_exadata_infrastructures_operations.py deleted file mode 100644 index 8fcb5a0b3098..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_exadata_infrastructures_operations.py +++ /dev/null @@ -1,915 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._cloud_exadata_infrastructures_operations import ( - build_add_storage_capacity_request, - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class CloudExadataInfrastructuresOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`cloud_exadata_infrastructures` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CloudExadataInfrastructure"]: - """List CloudExadataInfrastructure resources by subscription ID. - - :return: An iterator like instance of either CloudExadataInfrastructure or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudExadataInfrastructureListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructureListResult", 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.CloudExadataInfrastructure"]: - """List CloudExadataInfrastructure resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either CloudExadataInfrastructure or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudExadataInfrastructureListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_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 = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructureListResult", 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( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> _models.CloudExadataInfrastructure: - """Get a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :return: CloudExadataInfrastructure or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("CloudExadataInfrastructure", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - resource: Union[_models.CloudExadataInfrastructure, IO[bytes]], - **kwargs: Any - ) -> _models.CloudExadataInfrastructure: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "CloudExadataInfrastructure") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - resource: _models.CloudExadataInfrastructure, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: - """Create a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure - :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 CloudExadataInfrastructure or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: - """Create a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either CloudExadataInfrastructure or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - resource: Union[_models.CloudExadataInfrastructure, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: - """Create a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param resource: Resource create parameters. Is either a CloudExadataInfrastructure type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure or IO[bytes] - :return: An instance of AsyncLROPoller that returns either CloudExadataInfrastructure or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudExadataInfrastructure] = 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, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CloudExadataInfrastructure].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CloudExadataInfrastructure]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - properties: Union[_models.CloudExadataInfrastructureUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.CloudExadataInfrastructure]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CloudExadataInfrastructure]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "CloudExadataInfrastructureUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - properties: _models.CloudExadataInfrastructureUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: - """Update a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdate - :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 CloudExadataInfrastructure or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: - """Update a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 CloudExadataInfrastructure or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - properties: Union[_models.CloudExadataInfrastructureUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: - """Update a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param properties: The resource properties to be updated. Is either a - CloudExadataInfrastructureUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdate or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either CloudExadataInfrastructure or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CloudExadataInfrastructure].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CloudExadataInfrastructure]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _add_storage_capacity_initial( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> Optional[_models.CloudExadataInfrastructure]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.CloudExadataInfrastructure]] = kwargs.pop("cls", None) - - _request = build_add_storage_capacity_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_add_storage_capacity( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: - """Perform add storage capacity on exadata infra. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :return: An instance of AsyncLROPoller that returns either CloudExadataInfrastructure or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudExadataInfrastructure] = 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._add_storage_capacity_initial( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CloudExadataInfrastructure].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CloudExadataInfrastructure]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_vm_clusters_operations.py deleted file mode 100644 index f36dae9ee560..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_vm_clusters_operations.py +++ /dev/null @@ -1,1316 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._cloud_vm_clusters_operations import ( - build_add_vms_request, - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_list_private_ip_addresses_request, - build_remove_vms_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class CloudVmClustersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`cloud_vm_clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CloudVmCluster"]: - """List CloudVmCluster resources by subscription ID. - - :return: An iterator like instance of either CloudVmCluster or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudVmClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CloudVmClusterListResult", 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.CloudVmCluster"]: - """List CloudVmCluster resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either CloudVmCluster or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudVmClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_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 = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CloudVmClusterListResult", 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(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) -> _models.CloudVmCluster: - """Get a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :return: CloudVmCluster or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.CloudVmCluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("CloudVmCluster", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - resource: Union[_models.CloudVmCluster, IO[bytes]], - **kwargs: Any - ) -> _models.CloudVmCluster: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "CloudVmCluster") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - resource: _models.CloudVmCluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Create a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.CloudVmCluster - :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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Create a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - resource: Union[_models.CloudVmCluster, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Create a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param resource: Resource create parameters. Is either a CloudVmCluster type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.CloudVmCluster or IO[bytes] - :return: An instance of AsyncLROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = 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, - cloudvmclustername=cloudvmclustername, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CloudVmCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CloudVmCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - properties: Union[_models.CloudVmClusterUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "CloudVmClusterUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - cloudvmclustername: str, - properties: _models.CloudVmClusterUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Update a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdate - :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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cloudvmclustername: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Update a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - cloudvmclustername: str, - properties: Union[_models.CloudVmClusterUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Update a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param properties: The resource properties to be updated. Is either a CloudVmClusterUpdate type - or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CloudVmCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CloudVmCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _add_vms_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.AddRemoveDbNode, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "AddRemoveDbNode") - - _request = build_add_vms_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_add_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: _models.AddRemoveDbNode, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Add VMs to the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode - :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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_add_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Add VMs to the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: 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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_add_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.AddRemoveDbNode, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Add VMs to the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Is either a AddRemoveDbNode type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode or IO[bytes] - :return: An instance of AsyncLROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = 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._add_vms_initial( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CloudVmCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CloudVmCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def list_private_ip_addresses( - self, - resource_group_name: str, - cloudvmclustername: str, - body: _models.PrivateIpAddressesFilter, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> List[_models.PrivateIpAddressProperties]: - """List Private IP Addresses by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.PrivateIpAddressesFilter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: list of PrivateIpAddressProperties or the result of cls(response) - :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def list_private_ip_addresses( - self, - resource_group_name: str, - cloudvmclustername: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> List[_models.PrivateIpAddressProperties]: - """List Private IP Addresses by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: 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: list of PrivateIpAddressProperties or the result of cls(response) - :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def list_private_ip_addresses( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.PrivateIpAddressesFilter, IO[bytes]], - **kwargs: Any - ) -> List[_models.PrivateIpAddressProperties]: - """List Private IP Addresses by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Is either a PrivateIpAddressesFilter type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.oracledatabase.models.PrivateIpAddressesFilter or IO[bytes] - :return: list of PrivateIpAddressProperties or the result of cls(response) - :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[List[_models.PrivateIpAddressProperties]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "PrivateIpAddressesFilter") - - _request = build_list_private_ip_addresses_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("[PrivateIpAddressProperties]", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _remove_vms_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.AddRemoveDbNode, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "AddRemoveDbNode") - - _request = build_remove_vms_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_remove_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: _models.AddRemoveDbNode, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Remove VMs from the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode - :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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_remove_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Remove VMs from the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: 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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_remove_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.AddRemoveDbNode, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CloudVmCluster]: - """Remove VMs from the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Is either a AddRemoveDbNode type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode or IO[bytes] - :return: An instance of AsyncLROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = 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._remove_vms_initial( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CloudVmCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CloudVmCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_nodes_operations.py deleted file mode 100644 index e2282ff5e363..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_nodes_operations.py +++ /dev/null @@ -1,423 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._db_nodes_operations import ( - build_action_request, - build_get_request, - build_list_by_cloud_vm_cluster_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DbNodesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`db_nodes` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cloud_vm_cluster( - self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any - ) -> AsyncIterable["_models.DbNode"]: - """List DbNode resources by CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :return: An iterator like instance of either DbNode or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DbNode] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbNodeListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_cloud_vm_cluster_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DbNodeListResult", 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( - self, resource_group_name: str, cloudvmclustername: str, dbnodeocid: str, **kwargs: Any - ) -> _models.DbNode: - """Get a DbNode. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param dbnodeocid: DbNode OCID. Required. - :type dbnodeocid: str - :return: DbNode or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DbNode - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbNode] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - dbnodeocid=dbnodeocid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DbNode", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _action_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - dbnodeocid: str, - body: Union[_models.DbNodeAction, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.DbNode]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.DbNode]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "DbNodeAction") - - _request = build_action_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - dbnodeocid=dbnodeocid, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("DbNode", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_action( - self, - resource_group_name: str, - cloudvmclustername: str, - dbnodeocid: str, - body: _models.DbNodeAction, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DbNode]: - """VM actions on DbNode of VM Cluster by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param dbnodeocid: DbNode OCID. Required. - :type dbnodeocid: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction - :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 DbNode or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbNode] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_action( - self, - resource_group_name: str, - cloudvmclustername: str, - dbnodeocid: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DbNode]: - """VM actions on DbNode of VM Cluster by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param dbnodeocid: DbNode OCID. Required. - :type dbnodeocid: str - :param body: The content of the action request. Required. - :type body: 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 DbNode or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbNode] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_action( - self, - resource_group_name: str, - cloudvmclustername: str, - dbnodeocid: str, - body: Union[_models.DbNodeAction, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DbNode]: - """VM actions on DbNode of VM Cluster by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param dbnodeocid: DbNode OCID. Required. - :type dbnodeocid: str - :param body: The content of the action request. Is either a DbNodeAction type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction or IO[bytes] - :return: An instance of AsyncLROPoller that returns either DbNode or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbNode] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DbNode] = 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._action_initial( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - dbnodeocid=dbnodeocid, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DbNode", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DbNode].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DbNode]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_servers_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_servers_operations.py deleted file mode 100644 index 7486cba97bfd..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_servers_operations.py +++ /dev/null @@ -1,207 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._db_servers_operations import build_get_request, build_list_by_cloud_exadata_infrastructure_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DbServersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`db_servers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cloud_exadata_infrastructure( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> AsyncIterable["_models.DbServer"]: - """List DbServer resources by CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :return: An iterator like instance of either DbServer or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DbServer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_cloud_exadata_infrastructure_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DbServerListResult", 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( - self, resource_group_name: str, cloudexadatainfrastructurename: str, dbserverocid: str, **kwargs: Any - ) -> _models.DbServer: - """Get a DbServer. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param dbserverocid: DbServer OCID. Required. - :type dbserverocid: str - :return: DbServer or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DbServer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbServer] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - dbserverocid=dbserverocid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DbServer", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_system_shapes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_system_shapes_operations.py deleted file mode 100644 index d3886d5f0334..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_system_shapes_operations.py +++ /dev/null @@ -1,196 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._db_system_shapes_operations import build_get_request, build_list_by_location_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DbSystemShapesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`db_system_shapes` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.DbSystemShape"]: - """List DbSystemShape resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either DbSystemShape or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DbSystemShape] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbSystemShapeListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DbSystemShapeListResult", 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(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _models.DbSystemShape: - """Get a DbSystemShape. - - :param location: The name of the Azure region. Required. - :type location: str - :param dbsystemshapename: DbSystemShape name. Required. - :type dbsystemshapename: str - :return: DbSystemShape or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DbSystemShape - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbSystemShape] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - dbsystemshapename=dbsystemshapename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DbSystemShape", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_views_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_views_operations.py deleted file mode 100644 index 3e3eca3bdf66..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_views_operations.py +++ /dev/null @@ -1,196 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._dns_private_views_operations import build_get_request, build_list_by_location_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DnsPrivateViewsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`dns_private_views` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.DnsPrivateView"]: - """List DnsPrivateView resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either DnsPrivateView or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DnsPrivateView] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DnsPrivateViewListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DnsPrivateViewListResult", 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(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _models.DnsPrivateView: - """Get a DnsPrivateView. - - :param location: The name of the Azure region. Required. - :type location: str - :param dnsprivateviewocid: DnsPrivateView OCID. Required. - :type dnsprivateviewocid: str - :return: DnsPrivateView or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateView - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DnsPrivateView] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - dnsprivateviewocid=dnsprivateviewocid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DnsPrivateView", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_zones_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_zones_operations.py deleted file mode 100644 index 68ed09996dab..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_zones_operations.py +++ /dev/null @@ -1,196 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._dns_private_zones_operations import build_get_request, build_list_by_location_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DnsPrivateZonesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`dns_private_zones` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.DnsPrivateZone"]: - """List DnsPrivateZone resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either DnsPrivateZone or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DnsPrivateZone] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DnsPrivateZoneListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DnsPrivateZoneListResult", 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(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _models.DnsPrivateZone: - """Get a DnsPrivateZone. - - :param location: The name of the Azure region. Required. - :type location: str - :param dnsprivatezonename: DnsPrivateZone name. Required. - :type dnsprivatezonename: str - :return: DnsPrivateZone or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateZone - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DnsPrivateZone] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - dnsprivatezonename=dnsprivatezonename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DnsPrivateZone", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_versions_operations.py deleted file mode 100644 index 02def620d5f9..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_versions_operations.py +++ /dev/null @@ -1,195 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._gi_versions_operations import build_get_request, build_list_by_location_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GiVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`gi_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.GiVersion"]: - """List GiVersion resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either GiVersion or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.GiVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GiVersionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GiVersionListResult", 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(self, location: str, giversionname: str, **kwargs: Any) -> _models.GiVersion: - """Get a GiVersion. - - :param location: The name of the Azure region. Required. - :type location: str - :param giversionname: GiVersion name. Required. - :type giversionname: str - :return: GiVersion or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.GiVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GiVersion] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - giversionname=giversionname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("GiVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_operations.py index 7be3a96a0294..e1ab85a7bc00 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_operations.py @@ -1,15 +1,18 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, Dict, IO, List, 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, @@ -17,25 +20,118 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ..._vendor import _convert_request -from ...operations._operations import build_list_request +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation +from ...operations._operations import ( + build_autonomous_database_backups_create_or_update_request, + build_autonomous_database_backups_delete_request, + build_autonomous_database_backups_get_request, + build_autonomous_database_backups_list_by_parent_request, + build_autonomous_database_backups_update_request, + build_autonomous_database_character_sets_get_request, + build_autonomous_database_character_sets_list_by_location_request, + build_autonomous_database_national_character_sets_get_request, + build_autonomous_database_national_character_sets_list_by_location_request, + build_autonomous_database_versions_get_request, + build_autonomous_database_versions_list_by_location_request, + build_autonomous_databases_change_disaster_recovery_configuration_request, + build_autonomous_databases_create_or_update_request, + build_autonomous_databases_delete_request, + build_autonomous_databases_failover_request, + build_autonomous_databases_generate_wallet_request, + build_autonomous_databases_get_request, + build_autonomous_databases_list_by_resource_group_request, + build_autonomous_databases_list_by_subscription_request, + build_autonomous_databases_restore_request, + build_autonomous_databases_shrink_request, + build_autonomous_databases_switchover_request, + build_autonomous_databases_update_request, + build_cloud_exadata_infrastructures_add_storage_capacity_request, + build_cloud_exadata_infrastructures_create_or_update_request, + build_cloud_exadata_infrastructures_delete_request, + build_cloud_exadata_infrastructures_get_request, + build_cloud_exadata_infrastructures_list_by_resource_group_request, + build_cloud_exadata_infrastructures_list_by_subscription_request, + build_cloud_exadata_infrastructures_update_request, + build_cloud_vm_clusters_add_vms_request, + build_cloud_vm_clusters_create_or_update_request, + build_cloud_vm_clusters_delete_request, + build_cloud_vm_clusters_get_request, + build_cloud_vm_clusters_list_by_resource_group_request, + build_cloud_vm_clusters_list_by_subscription_request, + build_cloud_vm_clusters_list_private_ip_addresses_request, + build_cloud_vm_clusters_remove_vms_request, + build_cloud_vm_clusters_update_request, + build_db_nodes_action_request, + build_db_nodes_get_request, + build_db_nodes_list_by_parent_request, + build_db_servers_get_request, + build_db_servers_list_by_parent_request, + build_db_system_shapes_get_request, + build_db_system_shapes_list_by_location_request, + build_dns_private_views_get_request, + build_dns_private_views_list_by_location_request, + build_dns_private_zones_get_request, + build_dns_private_zones_list_by_location_request, + build_exadb_vm_clusters_create_or_update_request, + build_exadb_vm_clusters_delete_request, + build_exadb_vm_clusters_get_request, + build_exadb_vm_clusters_list_by_resource_group_request, + build_exadb_vm_clusters_list_by_subscription_request, + build_exadb_vm_clusters_remove_vms_request, + build_exadb_vm_clusters_update_request, + build_exascale_db_nodes_action_request, + build_exascale_db_nodes_get_request, + build_exascale_db_nodes_list_by_parent_request, + build_exascale_db_storage_vaults_create_request, + build_exascale_db_storage_vaults_delete_request, + build_exascale_db_storage_vaults_get_request, + build_exascale_db_storage_vaults_list_by_resource_group_request, + build_exascale_db_storage_vaults_list_by_subscription_request, + build_exascale_db_storage_vaults_update_request, + build_flex_components_get_request, + build_flex_components_list_by_parent_request, + build_gi_minor_versions_get_request, + build_gi_minor_versions_list_by_parent_request, + build_gi_versions_get_request, + build_gi_versions_list_by_location_request, + build_operations_list_request, + build_oracle_subscriptions_add_azure_subscriptions_request, + build_oracle_subscriptions_create_or_update_request, + build_oracle_subscriptions_delete_request, + build_oracle_subscriptions_get_request, + build_oracle_subscriptions_list_activation_links_request, + build_oracle_subscriptions_list_by_subscription_request, + build_oracle_subscriptions_list_cloud_account_details_request, + build_oracle_subscriptions_list_saas_subscription_details_request, + build_oracle_subscriptions_update_request, + build_system_versions_get_request, + build_system_versions_list_by_location_request, + build_virtual_network_addresses_create_or_update_request, + build_virtual_network_addresses_delete_request, + build_virtual_network_addresses_get_request, + build_virtual_network_addresses_list_by_parent_request, +) +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] class Operations: @@ -48,30 +144,129 @@ class Operations: :attr:`operations` attribute. """ - models = _models - def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """List the operations for the provider. - :return: An iterator like instance of either Operation or the result of cls(response) + :return: An iterator like instance of Operation :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = 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_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class CloudExadataInfrastructuresOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`cloud_exadata_infrastructures` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.CloudExadataInfrastructure"]: + """List CloudExadataInfrastructure resources by subscription ID. + + :return: An iterator like instance of CloudExadataInfrastructure + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CloudExadataInfrastructure]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -82,13 +277,18 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_cloud_exadata_infrastructures_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -103,17 +303,12052 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.CloudExadataInfrastructure], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + 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, + cloudexadatainfrastructurename: str, + resource: Union[_models.CloudExadataInfrastructure, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_exadata_infrastructures_create_or_update_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + resource: _models.CloudExadataInfrastructure, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: + """Create a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure + :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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: + """Create a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: + """Create a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + resource: Union[_models.CloudExadataInfrastructure, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: + """Create a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param resource: Resource create parameters. Is one of the following types: + CloudExadataInfrastructure, JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudExadataInfrastructure] = 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, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudExadataInfrastructure, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CloudExadataInfrastructure].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CloudExadataInfrastructure]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any + ) -> _models.CloudExadataInfrastructure: + """Get a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :return: CloudExadataInfrastructure. The CloudExadataInfrastructure is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) + + _request = build_cloud_exadata_infrastructures_get_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.CloudExadataInfrastructure, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: Union[_models.CloudExadataInfrastructureUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_exadata_infrastructures_update_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: _models.CloudExadataInfrastructureUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: + """Update a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdate + :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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: + """Update a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: + """Update a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: Union[_models.CloudExadataInfrastructureUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: + """Update a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param properties: The resource properties to be updated. Is one of the following types: + CloudExadataInfrastructureUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdate or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudExadataInfrastructure, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CloudExadataInfrastructure].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CloudExadataInfrastructure]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, cloudexadatainfrastructurename: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_cloud_exadata_infrastructures_delete_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.CloudExadataInfrastructure"]: + """List CloudExadataInfrastructure resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of CloudExadataInfrastructure + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.CloudExadataInfrastructure]] = 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_cloud_exadata_infrastructures_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.CloudExadataInfrastructure], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _add_storage_capacity_initial( + self, resource_group_name: str, cloudexadatainfrastructurename: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_cloud_exadata_infrastructures_add_storage_capacity_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_add_storage_capacity( + self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any + ) -> AsyncLROPoller[_models.CloudExadataInfrastructure]: + """Perform add storage capacity on exadata infra. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :return: An instance of AsyncLROPoller that returns CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CloudExadataInfrastructure] = 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._add_storage_capacity_initial( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CloudExadataInfrastructure, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CloudExadataInfrastructure].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CloudExadataInfrastructure]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ListActionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`list_actions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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") + + +class DbServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`db_servers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cloudexadatainfrastructurename: str, dbserverocid: str, **kwargs: Any + ) -> _models.DbServer: + """Get a DbServer. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param dbserverocid: DbServer OCID. Required. + :type dbserverocid: str + :return: DbServer. The DbServer is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DbServer + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DbServer] = kwargs.pop("cls", None) + + _request = build_db_servers_get_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + dbserverocid=dbserverocid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DbServer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_parent( + self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DbServer"]: + """List DbServer resources by CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :return: An iterator like instance of DbServer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DbServer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DbServer]] = 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_db_servers_list_by_parent_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DbServer], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class CloudVmClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`cloud_vm_clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.CloudVmCluster"]: + """List CloudVmCluster resources by subscription ID. + + :return: An iterator like instance of CloudVmCluster + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.CloudVmCluster]] = 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_cloud_vm_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.CloudVmCluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + 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, + cloudvmclustername: str, + resource: Union[_models.CloudVmCluster, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_create_or_update_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + resource: _models.CloudVmCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Create a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.CloudVmCluster + :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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Create a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Create a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + resource: Union[_models.CloudVmCluster, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Create a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param resource: Resource create parameters. Is one of the following types: CloudVmCluster, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.CloudVmCluster or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudVmCluster] = 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, + cloudvmclustername=cloudvmclustername, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CloudVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CloudVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) -> _models.CloudVmCluster: + """Get a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :return: CloudVmCluster. The CloudVmCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.CloudVmCluster + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) + + _request = build_cloud_vm_clusters_get_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: Union[_models.CloudVmClusterUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_update_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: _models.CloudVmClusterUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Update a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdate + :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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Update a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Update a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: Union[_models.CloudVmClusterUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Update a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param properties: The resource properties to be updated. Is one of the following types: + CloudVmClusterUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CloudVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CloudVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, cloudvmclustername: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_cloud_vm_clusters_delete_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.CloudVmCluster"]: + """List CloudVmCluster resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of CloudVmCluster + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.CloudVmCluster]] = 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_cloud_vm_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.CloudVmCluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _add_vms_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.AddRemoveDbNode, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_add_vms_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_add_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: _models.AddRemoveDbNode, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Add VMs to the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode + :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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_add_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Add VMs to the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: JSON + :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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_add_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Add VMs to the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: 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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_add_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.AddRemoveDbNode, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Add VMs to the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Is one of the following types: AddRemoveDbNode, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudVmCluster] = 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._add_vms_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CloudVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CloudVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _remove_vms_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.AddRemoveDbNode, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_remove_vms_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_remove_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: _models.AddRemoveDbNode, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode + :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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_remove_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: JSON + :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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_remove_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: 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 CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_remove_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.AddRemoveDbNode, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CloudVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Is one of the following types: AddRemoveDbNode, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns CloudVmCluster. The CloudVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudVmCluster] = 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._remove_vms_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CloudVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CloudVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def list_private_ip_addresses( + self, + resource_group_name: str, + cloudvmclustername: str, + body: _models.PrivateIpAddressesFilter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.PrivateIpAddressProperties]: + """List Private IP Addresses by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.PrivateIpAddressesFilter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of PrivateIpAddressProperties + :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_private_ip_addresses( + self, + resource_group_name: str, + cloudvmclustername: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.PrivateIpAddressProperties]: + """List Private IP Addresses by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of PrivateIpAddressProperties + :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_private_ip_addresses( + self, + resource_group_name: str, + cloudvmclustername: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.PrivateIpAddressProperties]: + """List Private IP Addresses by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: 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: list of PrivateIpAddressProperties + :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_private_ip_addresses( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.PrivateIpAddressesFilter, JSON, IO[bytes]], + **kwargs: Any + ) -> List[_models.PrivateIpAddressProperties]: + """List Private IP Addresses by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Is one of the following types: + PrivateIpAddressesFilter, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.PrivateIpAddressesFilter or JSON or IO[bytes] + :return: list of PrivateIpAddressProperties + :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] + :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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.PrivateIpAddressProperties]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_list_private_ip_addresses_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.PrivateIpAddressProperties], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VirtualNetworkAddressesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`virtual_network_addresses` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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") + + async def _create_or_update_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: Union[_models.VirtualNetworkAddress, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_virtual_network_addresses_create_or_update_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: _models.VirtualNetworkAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkAddress]: + """Create a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress + :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 VirtualNetworkAddress. The + VirtualNetworkAddress is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkAddress]: + """Create a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 VirtualNetworkAddress. The + VirtualNetworkAddress is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkAddress]: + """Create a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns VirtualNetworkAddress. The + VirtualNetworkAddress is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: Union[_models.VirtualNetworkAddress, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkAddress]: + """Create a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :param resource: Resource create parameters. Is one of the following types: + VirtualNetworkAddress, JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns VirtualNetworkAddress. The + VirtualNetworkAddress is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkAddress] = 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, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VirtualNetworkAddress, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkAddress].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkAddress]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any + ) -> _models.VirtualNetworkAddress: + """Get a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :return: VirtualNetworkAddress. The VirtualNetworkAddress is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VirtualNetworkAddress] = kwargs.pop("cls", None) + + _request = build_virtual_network_addresses_get_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.VirtualNetworkAddress, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_virtual_network_addresses_delete_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_parent( + self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any + ) -> AsyncItemPaged["_models.VirtualNetworkAddress"]: + """List VirtualNetworkAddress resources by CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :return: An iterator like instance of VirtualNetworkAddress + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VirtualNetworkAddress]] = 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_virtual_network_addresses_list_by_parent_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.VirtualNetworkAddress], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SystemVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`system_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, systemversionname: str, **kwargs: Any) -> _models.SystemVersion: + """Get a SystemVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param systemversionname: SystemVersion name. Required. + :type systemversionname: str + :return: SystemVersion. The SystemVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.SystemVersion + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SystemVersion] = kwargs.pop("cls", None) + + _request = build_system_versions_get_request( + location=location, + systemversionname=systemversionname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SystemVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.SystemVersion"]: + """List SystemVersion resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of SystemVersion + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.SystemVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SystemVersion]] = 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_system_versions_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.SystemVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class OracleSubscriptionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`oracle_subscriptions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.OracleSubscription"]: + """List OracleSubscription resources by subscription ID. + + :return: An iterator like instance of OracleSubscription + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OracleSubscription]] = 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_oracle_subscriptions_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.OracleSubscription], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + 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: Union[_models.OracleSubscription, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_oracle_subscriptions_create_or_update_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, resource: _models.OracleSubscription, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.OracleSubscription]: + """Create a OracleSubscription. + + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.OracleSubscription + :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 OracleSubscription. The OracleSubscription + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, resource: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.OracleSubscription]: + """Create a OracleSubscription. + + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 OracleSubscription. The OracleSubscription + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.OracleSubscription]: + """Create a OracleSubscription. + + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns OracleSubscription. The OracleSubscription + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, resource: Union[_models.OracleSubscription, JSON, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[_models.OracleSubscription]: + """Create a OracleSubscription. + + :param resource: Resource create parameters. Is one of the following types: OracleSubscription, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.OracleSubscription or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns OracleSubscription. The OracleSubscription + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OracleSubscription] = 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=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.OracleSubscription, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OracleSubscription].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OracleSubscription]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get(self, **kwargs: Any) -> _models.OracleSubscription: + """Get a OracleSubscription. + + :return: OracleSubscription. The OracleSubscription is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.OracleSubscription + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_get_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.OracleSubscription, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_initial( + self, properties: Union[_models.OracleSubscriptionUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_oracle_subscriptions_update_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, properties: _models.OracleSubscriptionUpdate, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.OracleSubscription]: + """Update a OracleSubscription. + + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdate + :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 OracleSubscription. The OracleSubscription + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, properties: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.OracleSubscription]: + """Update a OracleSubscription. + + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 OracleSubscription. The OracleSubscription + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.OracleSubscription]: + """Update a OracleSubscription. + + :param properties: The resource properties to be updated. Required. + :type properties: 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 OracleSubscription. The OracleSubscription + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, properties: Union[_models.OracleSubscriptionUpdate, JSON, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[_models.OracleSubscription]: + """Update a OracleSubscription. + + :param properties: The resource properties to be updated. Is one of the following types: + OracleSubscriptionUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdate or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns OracleSubscription. The OracleSubscription + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.OracleSubscription, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OracleSubscription].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OracleSubscription]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial(self, **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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_delete_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a OracleSubscription. + + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial(cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _list_cloud_account_details_initial(self, **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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_list_cloud_account_details_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_cloud_account_details(self, **kwargs: Any) -> AsyncLROPoller[_models.CloudAccountDetails]: + """List Cloud Account Details. + + :return: An instance of AsyncLROPoller that returns CloudAccountDetails. The + CloudAccountDetails is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudAccountDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CloudAccountDetails] = 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._list_cloud_account_details_initial( + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudAccountDetails, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CloudAccountDetails].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CloudAccountDetails]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _list_saas_subscription_details_initial(self, **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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_list_saas_subscription_details_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_saas_subscription_details( + self, **kwargs: Any + ) -> AsyncLROPoller[_models.SaasSubscriptionDetails]: + """List Saas Subscription Details. + + :return: An instance of AsyncLROPoller that returns SaasSubscriptionDetails. The + SaasSubscriptionDetails is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.SaasSubscriptionDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SaasSubscriptionDetails] = 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._list_saas_subscription_details_initial( + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SaasSubscriptionDetails, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SaasSubscriptionDetails].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SaasSubscriptionDetails]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _list_activation_links_initial(self, **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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_list_activation_links_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_list_activation_links(self, **kwargs: Any) -> AsyncLROPoller[_models.ActivationLinks]: + """List Activation Links. + + :return: An instance of AsyncLROPoller that returns ActivationLinks. The ActivationLinks is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ActivationLinks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ActivationLinks] = 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._list_activation_links_initial( + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ActivationLinks, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ActivationLinks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ActivationLinks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-06-01-preview", + params_added_on={"2024-06-01-preview": ["api_version", "subscription_id", "content_type", "accept"]}, + ) + async def _add_azure_subscriptions_initial( + self, body: Union[_models.AzureSubscriptions, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_oracle_subscriptions_add_azure_subscriptions_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_add_azure_subscriptions( + self, body: _models.AzureSubscriptions, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.AzureSubscriptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_add_azure_subscriptions( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_add_azure_subscriptions( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-06-01-preview", + params_added_on={"2024-06-01-preview": ["api_version", "subscription_id", "content_type", "accept"]}, + ) + async def begin_add_azure_subscriptions( + self, body: Union[_models.AzureSubscriptions, JSON, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Is one of the following types: + AzureSubscriptions, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.AzureSubscriptions or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._add_azure_subscriptions_initial( + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class DbNodesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`db_nodes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cloudvmclustername: str, dbnodeocid: str, **kwargs: Any + ) -> _models.DbNode: + """Get a DbNode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :return: DbNode. The DbNode is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DbNode + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DbNode] = kwargs.pop("cls", None) + + _request = build_db_nodes_get_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + dbnodeocid=dbnodeocid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DbNode, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_parent( + self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DbNode"]: + """List DbNode resources by CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :return: An iterator like instance of DbNode + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DbNode]] = 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_db_nodes_list_by_parent_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DbNode], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _action_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: Union[_models.DbNodeAction, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_db_nodes_action_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + dbnodeocid=dbnodeocid, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_action( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: _models.DbNodeAction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DbNode]: + """VM actions on DbNode of VM Cluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction + :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 DbNode. The DbNode is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_action( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DbNode]: + """VM actions on DbNode of VM Cluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :param body: The content of the action request. Required. + :type body: JSON + :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 DbNode. The DbNode is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_action( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DbNode]: + """VM actions on DbNode of VM Cluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :param body: The content of the action request. Required. + :type body: 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 DbNode. The DbNode is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_action( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: Union[_models.DbNodeAction, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DbNode]: + """VM actions on DbNode of VM Cluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :param body: The content of the action request. Is one of the following types: DbNodeAction, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns DbNode. The DbNode is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DbNode] = 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._action_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + dbnodeocid=dbnodeocid, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DbNode, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DbNode].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DbNode]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class GiVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`gi_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, giversionname: str, **kwargs: Any) -> _models.GiVersion: + """Get a GiVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :return: GiVersion. The GiVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.GiVersion + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GiVersion] = kwargs.pop("cls", None) + + _request = build_gi_versions_get_request( + location=location, + giversionname=giversionname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.GiVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": ["api_version", "subscription_id", "location", "shape", "zone", "accept"] + }, + ) + def list_by_location( + self, + location: str, + *, + shape: Optional[Union[str, _models.SystemShapes]] = None, + zone: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.GiVersion"]: + """List GiVersion resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :keyword shape: If provided, filters the results for the given shape. Known values are: + "Exadata.X9M", "Exadata.X11M", and "ExaDbXS". Default value is None. + :paramtype shape: str or ~azure.mgmt.oracledatabase.models.SystemShapes + :keyword zone: Filters the result for the given Azure Availability Zone. Default value is None. + :paramtype zone: str + :return: An iterator like instance of GiVersion + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.GiVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.GiVersion]] = 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_gi_versions_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + shape=shape, + zone=zone, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.GiVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class GiMinorVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`gi_minor_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "location", + "giversionname", + "shape_family", + "zone", + "accept", + ] + }, + ) + def list_by_parent( + self, + location: str, + giversionname: str, + *, + shape_family: Optional[Union[str, _models.ShapeFamily]] = None, + zone: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.GiMinorVersion"]: + """List GiMinorVersion resources by GiVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :keyword shape_family: If provided, filters the results to the set of database versions which + are supported for the given shape family. Known values are: "EXADATA" and "EXADB_XS". Default + value is None. + :paramtype shape_family: str or ~azure.mgmt.oracledatabase.models.ShapeFamily + :keyword zone: Filters the result for the given Azure Availability Zone. Default value is None. + :paramtype zone: str + :return: An iterator like instance of GiMinorVersion + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.GiMinorVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.GiMinorVersion]] = 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_gi_minor_versions_list_by_parent_request( + location=location, + giversionname=giversionname, + subscription_id=self._config.subscription_id, + shape_family=shape_family, + zone=zone, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.GiMinorVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "location", + "giversionname", + "gi_minor_version_name", + "accept", + ] + }, + ) + async def get( + self, location: str, giversionname: str, gi_minor_version_name: str, **kwargs: Any + ) -> _models.GiMinorVersion: + """Get a GiMinorVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :param gi_minor_version_name: The name of the GiMinorVersion. Required. + :type gi_minor_version_name: str + :return: GiMinorVersion. The GiMinorVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.GiMinorVersion + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GiMinorVersion] = kwargs.pop("cls", None) + + _request = build_gi_minor_versions_get_request( + location=location, + giversionname=giversionname, + gi_minor_version_name=gi_minor_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.GiMinorVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DbSystemShapesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`db_system_shapes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _models.DbSystemShape: + """Get a DbSystemShape. + + :param location: The name of the Azure region. Required. + :type location: str + :param dbsystemshapename: DbSystemShape name. Required. + :type dbsystemshapename: str + :return: DbSystemShape. The DbSystemShape is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DbSystemShape + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DbSystemShape] = kwargs.pop("cls", None) + + _request = build_db_system_shapes_get_request( + location=location, + dbsystemshapename=dbsystemshapename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DbSystemShape, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "location", "zone", "accept"]}, + ) + def list_by_location( + self, location: str, *, zone: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.DbSystemShape"]: + """List DbSystemShape resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :keyword zone: Filters the result for the given Azure Availability Zone. Default value is None. + :paramtype zone: str + :return: An iterator like instance of DbSystemShape + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DbSystemShape] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DbSystemShape]] = 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_db_system_shapes_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + zone=zone, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DbSystemShape], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DnsPrivateViewsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`dns_private_views` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _models.DnsPrivateView: + """Get a DnsPrivateView. + + :param location: The name of the Azure region. Required. + :type location: str + :param dnsprivateviewocid: DnsPrivateView OCID. Required. + :type dnsprivateviewocid: str + :return: DnsPrivateView. The DnsPrivateView is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateView + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DnsPrivateView] = kwargs.pop("cls", None) + + _request = build_dns_private_views_get_request( + location=location, + dnsprivateviewocid=dnsprivateviewocid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DnsPrivateView, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.DnsPrivateView"]: + """List DnsPrivateView resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of DnsPrivateView + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DnsPrivateView] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DnsPrivateView]] = 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_dns_private_views_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DnsPrivateView], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DnsPrivateZonesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`dns_private_zones` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _models.DnsPrivateZone: + """Get a DnsPrivateZone. + + :param location: The name of the Azure region. Required. + :type location: str + :param dnsprivatezonename: DnsPrivateZone name. Required. + :type dnsprivatezonename: str + :return: DnsPrivateZone. The DnsPrivateZone is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateZone + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DnsPrivateZone] = kwargs.pop("cls", None) + + _request = build_dns_private_zones_get_request( + location=location, + dnsprivatezonename=dnsprivatezonename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DnsPrivateZone, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.DnsPrivateZone"]: + """List DnsPrivateZone resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of DnsPrivateZone + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DnsPrivateZone] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DnsPrivateZone]] = 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_dns_private_zones_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DnsPrivateZone], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FlexComponentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`flex_components` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-01-01-preview", + params_added_on={ + "2025-01-01-preview": ["api_version", "subscription_id", "location", "flex_component_name", "accept"] + }, + ) + async def get(self, location: str, flex_component_name: str, **kwargs: Any) -> _models.FlexComponent: + """Get a FlexComponent. + + :param location: The name of the Azure region. Required. + :type location: str + :param flex_component_name: The name of the FlexComponent. Required. + :type flex_component_name: str + :return: FlexComponent. The FlexComponent is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.FlexComponent + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FlexComponent] = kwargs.pop("cls", None) + + _request = build_flex_components_get_request( + location=location, + flex_component_name=flex_component_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.FlexComponent, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-01-01-preview", + params_added_on={"2025-01-01-preview": ["api_version", "subscription_id", "location", "shape", "accept"]}, + ) + def list_by_parent( + self, location: str, *, shape: Optional[Union[str, _models.SystemShapes]] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.FlexComponent"]: + """List FlexComponent resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :keyword shape: If provided, filters the results for the given shape. Known values are: + "Exadata.X9M", "Exadata.X11M", and "ExaDbXS". Default value is None. + :paramtype shape: str or ~azure.mgmt.oracledatabase.models.SystemShapes + :return: An iterator like instance of FlexComponent + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.FlexComponent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FlexComponent]] = 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_flex_components_list_by_parent_request( + location=location, + subscription_id=self._config.subscription_id, + shape=shape, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.FlexComponent], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AutonomousDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`autonomous_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.AutonomousDatabase"]: + """List AutonomousDatabase resources by subscription ID. + + :return: An iterator like instance of AutonomousDatabase + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabase]] = 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_autonomous_databases_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDatabase], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + 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, + autonomousdatabasename: str, + resource: Union[_models.AutonomousDatabase, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_create_or_update_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + resource: _models.AutonomousDatabase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Create a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabase + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Create a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Create a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + resource: Union[_models.AutonomousDatabase, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Create a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param resource: Resource create parameters. Is one of the following types: AutonomousDatabase, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabase or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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, + autonomousdatabasename=autonomousdatabasename, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any + ) -> _models.AutonomousDatabase: + """Get a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :return: AutonomousDatabase. The AutonomousDatabase is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabase + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) + + _request = build_autonomous_databases_get_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, autonomousdatabasename: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_autonomous_databases_delete_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: Union[_models.AutonomousDatabaseUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_update_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: _models.AutonomousDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Update a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdate + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Update a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Update a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: Union[_models.AutonomousDatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Update a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param properties: The resource properties to be updated. Is one of the following types: + AutonomousDatabaseUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdate or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.AutonomousDatabase"]: + """List AutonomousDatabase resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of AutonomousDatabase + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabase]] = 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_autonomous_databases_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDatabase], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _switchover_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.PeerDbDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_switchover_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_switchover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.PeerDbDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform switchover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_switchover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform switchover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_switchover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform switchover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_switchover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.PeerDbDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform switchover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: PeerDbDetails, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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._switchover_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _failover_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.PeerDbDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_failover_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_failover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.PeerDbDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform failover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_failover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform failover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_failover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform failover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_failover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.PeerDbDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform failover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: PeerDbDetails, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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._failover_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def generate_wallet( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.GenerateAutonomousDatabaseWalletDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AutonomousDatabaseWalletFile: + """Generate wallet action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.GenerateAutonomousDatabaseWalletDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AutonomousDatabaseWalletFile. The AutonomousDatabaseWalletFile is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def generate_wallet( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AutonomousDatabaseWalletFile: + """Generate wallet action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AutonomousDatabaseWalletFile. The AutonomousDatabaseWalletFile is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def generate_wallet( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AutonomousDatabaseWalletFile: + """Generate wallet action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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: AutonomousDatabaseWalletFile. The AutonomousDatabaseWalletFile is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def generate_wallet( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.GenerateAutonomousDatabaseWalletDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.AutonomousDatabaseWalletFile: + """Generate wallet action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: + GenerateAutonomousDatabaseWalletDetails, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.GenerateAutonomousDatabaseWalletDetails or JSON + or IO[bytes] + :return: AutonomousDatabaseWalletFile. The AutonomousDatabaseWalletFile is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile + :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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabaseWalletFile] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_generate_wallet_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabaseWalletFile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _restore_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.RestoreAutonomousDatabaseDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_restore_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_restore( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.RestoreAutonomousDatabaseDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Restores an Autonomous Database based on the provided request parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.RestoreAutonomousDatabaseDetails + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_restore( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Restores an Autonomous Database based on the provided request parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_restore( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Restores an Autonomous Database based on the provided request parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_restore( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.RestoreAutonomousDatabaseDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Restores an Autonomous Database based on the provided request parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: + RestoreAutonomousDatabaseDetails, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.RestoreAutonomousDatabaseDetails or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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._restore_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _shrink_initial( + self, resource_group_name: str, autonomousdatabasename: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_autonomous_databases_shrink_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_shrink( + self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """This operation shrinks the current allocated storage down to the current actual used data + storage. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :return: An instance of AsyncLROPoller that returns AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabase] = 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._shrink_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-10-01-preview", + params_added_on={ + "2024-10-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "autonomousdatabasename", + "content_type", + "accept", + ] + }, + ) + async def _change_disaster_recovery_configuration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.DisasterRecoveryConfigurationDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_change_disaster_recovery_configuration_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.DisasterRecoveryConfigurationDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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 AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-10-01-preview", + params_added_on={ + "2024-10-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "autonomousdatabasename", + "content_type", + "accept", + ] + }, + ) + async def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.DisasterRecoveryConfigurationDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: + DisasterRecoveryConfigurationDetails, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns AutonomousDatabase. The AutonomousDatabase + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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._change_disaster_recovery_configuration_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class AutonomousDatabaseBackupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`autonomous_database_backups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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") + + async def _create_or_update_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: Union[_models.AutonomousDatabaseBackup, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_database_backups_create_or_update_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: _models.AutonomousDatabaseBackup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: + """Create a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup + :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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: + """Create a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: + """Create a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: Union[_models.AutonomousDatabaseBackup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: + """Create a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param resource: Resource create parameters. Is one of the following types: + AutonomousDatabaseBackup, JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabaseBackup] = 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, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AutonomousDatabaseBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabaseBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabaseBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any + ) -> _models.AutonomousDatabaseBackup: + """Get a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :return: AutonomousDatabaseBackup. The AutonomousDatabaseBackup is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) + + _request = build_autonomous_database_backups_get_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabaseBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_autonomous_database_backups_delete_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: Union[_models.AutonomousDatabaseBackupUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_database_backups_update_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: _models.AutonomousDatabaseBackupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: + """Update a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdate + :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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: + """Update a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: + """Update a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: Union[_models.AutonomousDatabaseBackupUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabaseBackup]: + """Update a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param properties: The resource properties to be updated. Is one of the following types: + AutonomousDatabaseBackupUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdate or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AutonomousDatabaseBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabaseBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabaseBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_parent( + self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any + ) -> AsyncItemPaged["_models.AutonomousDatabaseBackup"]: + """List AutonomousDatabaseBackup resources by AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :return: An iterator like instance of AutonomousDatabaseBackup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabaseBackup]] = 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_autonomous_database_backups_list_by_parent_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDatabaseBackup], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AutonomousDatabaseCharacterSetsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`autonomous_database_character_sets` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, adbscharsetname: str, **kwargs: Any) -> _models.AutonomousDatabaseCharacterSet: + """Get a AutonomousDatabaseCharacterSet. + + :param location: The name of the Azure region. Required. + :type location: str + :param adbscharsetname: AutonomousDatabaseCharacterSet name. Required. + :type adbscharsetname: str + :return: AutonomousDatabaseCharacterSet. The AutonomousDatabaseCharacterSet is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabaseCharacterSet] = kwargs.pop("cls", None) + + _request = build_autonomous_database_character_sets_get_request( + location=location, + adbscharsetname=adbscharsetname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabaseCharacterSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location( + self, location: str, **kwargs: Any + ) -> AsyncItemPaged["_models.AutonomousDatabaseCharacterSet"]: + """List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of AutonomousDatabaseCharacterSet + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabaseCharacterSet]] = 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_autonomous_database_character_sets_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDatabaseCharacterSet], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AutonomousDatabaseNationalCharacterSetsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`autonomous_database_national_character_sets` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, location: str, adbsncharsetname: str, **kwargs: Any + ) -> _models.AutonomousDatabaseNationalCharacterSet: + """Get a AutonomousDatabaseNationalCharacterSet. + + :param location: The name of the Azure region. Required. + :type location: str + :param adbsncharsetname: AutonomousDatabaseNationalCharacterSets name. Required. + :type adbsncharsetname: str + :return: AutonomousDatabaseNationalCharacterSet. The AutonomousDatabaseNationalCharacterSet is + compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabaseNationalCharacterSet] = kwargs.pop("cls", None) + + _request = build_autonomous_database_national_character_sets_get_request( + location=location, + adbsncharsetname=adbsncharsetname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabaseNationalCharacterSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location( + self, location: str, **kwargs: Any + ) -> AsyncItemPaged["_models.AutonomousDatabaseNationalCharacterSet"]: + """List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of AutonomousDatabaseNationalCharacterSet + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabaseNationalCharacterSet]] = 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_autonomous_database_national_character_sets_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AutonomousDatabaseNationalCharacterSet], deserialized.get("value", []) + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AutonomousDatabaseVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`autonomous_database_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, autonomousdbversionsname: str, **kwargs: Any) -> _models.AutonomousDbVersion: + """Get a AutonomousDbVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param autonomousdbversionsname: AutonomousDbVersion name. Required. + :type autonomousdbversionsname: str + :return: AutonomousDbVersion. The AutonomousDbVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDbVersion + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDbVersion] = kwargs.pop("cls", None) + + _request = build_autonomous_database_versions_get_request( + location=location, + autonomousdbversionsname=autonomousdbversionsname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDbVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.AutonomousDbVersion"]: + """List AutonomousDbVersion resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of AutonomousDbVersion + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDbVersion]] = 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_autonomous_database_versions_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDbVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExadbVmClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`exadb_vm_clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "accept"]}, + ) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.ExadbVmCluster"]: + """List ExadbVmCluster resources by subscription ID. + + :return: An iterator like instance of ExadbVmCluster + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExadbVmCluster]] = 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_exadb_vm_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExadbVmCluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: Union[_models.ExadbVmCluster, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exadb_vm_clusters_create_or_update_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: _models.ExadbVmCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExadbVmCluster + :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 ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + async def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: Union[_models.ExadbVmCluster, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Is one of the following types: ExadbVmCluster, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExadbVmCluster or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExadbVmCluster] = 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, + exadb_vm_cluster_name=exadb_vm_cluster_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExadbVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "accept", + ] + }, + ) + async def get(self, resource_group_name: str, exadb_vm_cluster_name: str, **kwargs: Any) -> _models.ExadbVmCluster: + """Get a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: ExadbVmCluster. The ExadbVmCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.ExadbVmCluster + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExadbVmCluster] = kwargs.pop("cls", None) + + _request = build_exadb_vm_clusters_get_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.ExadbVmCluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + async def _update_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: Union[_models.ExadbVmClusterUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exadb_vm_clusters_update_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: _models.ExadbVmClusterUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdate + :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 ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + async def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: Union[_models.ExadbVmClusterUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Is one of the following types: + ExadbVmClusterUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExadbVmCluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExadbVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "accept", + ] + }, + ) + async def _delete_initial( + self, resource_group_name: str, exadb_vm_cluster_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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_exadb_vm_clusters_delete_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "accept", + ] + }, + ) + async def begin_delete( + self, resource_group_name: str, exadb_vm_cluster_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + ) + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ExadbVmCluster"]: + """List ExadbVmCluster resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ExadbVmCluster + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExadbVmCluster]] = 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_exadb_vm_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExadbVmCluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + async def _remove_vms_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: Union[_models.RemoveVirtualMachineFromExadbVmClusterDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exadb_vm_clusters_remove_vms_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: _models.RemoveVirtualMachineFromExadbVmClusterDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.RemoveVirtualMachineFromExadbVmClusterDetails + :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 ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: JSON + :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 ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: 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 ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + async def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: Union[_models.RemoveVirtualMachineFromExadbVmClusterDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Is one of the following types: + RemoveVirtualMachineFromExadbVmClusterDetails, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.RemoveVirtualMachineFromExadbVmClusterDetails or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ExadbVmCluster. The ExadbVmCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExadbVmCluster] = 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._remove_vms_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ExadbVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExascaleDbNodesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`exascale_db_nodes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "exascale_db_node_name", + "accept", + ] + }, + ) + async def get( + self, resource_group_name: str, exadb_vm_cluster_name: str, exascale_db_node_name: str, **kwargs: Any + ) -> _models.ExascaleDbNode: + """Get a ExascaleDbNode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :return: ExascaleDbNode. The ExascaleDbNode is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.ExascaleDbNode + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExascaleDbNode] = kwargs.pop("cls", None) + + _request = build_exascale_db_nodes_get_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.ExascaleDbNode, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "accept", + ] + }, + ) + def list_by_parent( + self, resource_group_name: str, exadb_vm_cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ExascaleDbNode"]: + """List ExascaleDbNode resources by ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: An iterator like instance of ExascaleDbNode + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExascaleDbNode]] = 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_exascale_db_nodes_list_by_parent_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExascaleDbNode], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "exascale_db_node_name", + "content_type", + "accept", + ] + }, + ) + async def _action_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: Union[_models.DbNodeAction, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exascale_db_nodes_action_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: _models.DbNodeAction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction + :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 DbActionResponse. The DbActionResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: JSON + :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 DbActionResponse. The DbActionResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: 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 DbActionResponse. The DbActionResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "exascale_db_node_name", + "content_type", + "accept", + ] + }, + ) + async def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: Union[_models.DbNodeAction, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Is one of the following types: DbNodeAction, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns DbActionResponse. The DbActionResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DbActionResponse] = 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._action_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_name, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DbActionResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DbActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DbActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExascaleDbStorageVaultsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`exascale_db_storage_vaults` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "accept", + ] + }, + ) + async def get( + self, resource_group_name: str, exascale_db_storage_vault_name: str, **kwargs: Any + ) -> _models.ExascaleDbStorageVault: + """Get a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :return: ExascaleDbStorageVault. The ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExascaleDbStorageVault] = kwargs.pop("cls", None) + + _request = build_exascale_db_storage_vaults_get_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.ExascaleDbStorageVault, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "content_type", + "accept", + ] + }, + ) + async def _create_initial( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: Union[_models.ExascaleDbStorageVault, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exascale_db_storage_vaults_create_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: _models.ExascaleDbStorageVault, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault + :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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "content_type", + "accept", + ] + }, + ) + async def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: Union[_models.ExascaleDbStorageVault, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Is one of the following types: + ExascaleDbStorageVault, JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExascaleDbStorageVault] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExascaleDbStorageVault, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExascaleDbStorageVault].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExascaleDbStorageVault]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "content_type", + "accept", + ] + }, + ) + async def _update_initial( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: Union[_models.ExascaleDbStorageVaultTagsUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exascale_db_storage_vaults_update_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: _models.ExascaleDbStorageVaultTagsUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultTagsUpdate + :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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "content_type", + "accept", + ] + }, + ) + async def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: Union[_models.ExascaleDbStorageVaultTagsUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Is one of the following types: + ExascaleDbStorageVaultTagsUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultTagsUpdate or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExascaleDbStorageVault] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExascaleDbStorageVault, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExascaleDbStorageVault].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExascaleDbStorageVault]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "accept", + ] + }, + ) + async def _delete_initial( + self, resource_group_name: str, exascale_db_storage_vault_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 = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_exascale_db_storage_vaults_delete_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "accept", + ] + }, + ) + async def begin_delete( + self, resource_group_name: str, exascale_db_storage_vault_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + ) + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ExascaleDbStorageVault"]: + """List ExascaleDbStorageVault resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ExascaleDbStorageVault + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExascaleDbStorageVault]] = 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_exascale_db_storage_vaults_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExascaleDbStorageVault], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "accept"]}, + ) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.ExascaleDbStorageVault"]: + """List ExascaleDbStorageVault resources by subscription ID. + + :return: An iterator like instance of ExascaleDbStorageVault + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExascaleDbStorageVault]] = 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_exascale_db_storage_vaults_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExascaleDbStorageVault], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -126,7 +12361,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_oracle_subscriptions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_oracle_subscriptions_operations.py deleted file mode 100644 index a192583eb309..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_oracle_subscriptions_operations.py +++ /dev/null @@ -1,907 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._oracle_subscriptions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_activation_links_request, - build_list_by_subscription_request, - build_list_cloud_account_details_request, - build_list_saas_subscription_details_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class OracleSubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`oracle_subscriptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.OracleSubscription"]: - """List OracleSubscription resources by subscription ID. - - :return: An iterator like instance of either OracleSubscription or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OracleSubscriptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OracleSubscriptionListResult", 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(self, **kwargs: Any) -> _models.OracleSubscription: - """Get a OracleSubscription. - - :return: OracleSubscription or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.OracleSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) - - _request = build_get_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("OracleSubscription", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, resource: Union[_models.OracleSubscription, IO[bytes]], **kwargs: Any - ) -> _models.OracleSubscription: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "OracleSubscription") - - _request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("OracleSubscription", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("OracleSubscription", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, resource: _models.OracleSubscription, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OracleSubscription]: - """Create a OracleSubscription. - - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.OracleSubscription - :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 OracleSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OracleSubscription]: - """Create a OracleSubscription. - - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either OracleSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, resource: Union[_models.OracleSubscription, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.OracleSubscription]: - """Create a OracleSubscription. - - :param resource: Resource create parameters. Is either a OracleSubscription type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.OracleSubscription or IO[bytes] - :return: An instance of AsyncLROPoller that returns either OracleSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OracleSubscription] = 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=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OracleSubscription", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.OracleSubscription].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OracleSubscription]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, properties: Union[_models.OracleSubscriptionUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.OracleSubscription]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OracleSubscription]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "OracleSubscriptionUpdate") - - _request = build_update_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("OracleSubscription", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, properties: _models.OracleSubscriptionUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OracleSubscription]: - """Update a OracleSubscription. - - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdate - :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 OracleSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.OracleSubscription]: - """Update a OracleSubscription. - - :param properties: The resource properties to be updated. Required. - :type properties: 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 OracleSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, properties: Union[_models.OracleSubscriptionUpdate, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.OracleSubscription]: - """Update a OracleSubscription. - - :param properties: The resource properties to be updated. Is either a OracleSubscriptionUpdate - type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either OracleSubscription or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OracleSubscription", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.OracleSubscription].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OracleSubscription]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete(self, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete a OracleSubscription. - - :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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_models.ActivationLinks]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.ActivationLinks]] = kwargs.pop("cls", None) - - _request = build_list_activation_links_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ActivationLinks", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_list_activation_links(self, **kwargs: Any) -> AsyncLROPoller[_models.ActivationLinks]: - """List Activation Links. - - :return: An instance of AsyncLROPoller that returns either ActivationLinks or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ActivationLinks] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ActivationLinks] = 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._list_activation_links_initial( - api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ActivationLinks", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ActivationLinks].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ActivationLinks]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_models.CloudAccountDetails]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.CloudAccountDetails]] = kwargs.pop("cls", None) - - _request = build_list_cloud_account_details_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudAccountDetails", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_list_cloud_account_details(self, **kwargs: Any) -> AsyncLROPoller[_models.CloudAccountDetails]: - """List Cloud Account Details. - - :return: An instance of AsyncLROPoller that returns either CloudAccountDetails or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.CloudAccountDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudAccountDetails] = 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._list_cloud_account_details_initial( - api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudAccountDetails", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CloudAccountDetails].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CloudAccountDetails]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Optional[_models.SaasSubscriptionDetails]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.SaasSubscriptionDetails]] = kwargs.pop("cls", None) - - _request = build_list_saas_subscription_details_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_list_saas_subscription_details( - self, **kwargs: Any - ) -> AsyncLROPoller[_models.SaasSubscriptionDetails]: - """List Saas Subscription Details. - - :return: An instance of AsyncLROPoller that returns either SaasSubscriptionDetails or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.SaasSubscriptionDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SaasSubscriptionDetails] = 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._list_saas_subscription_details_initial( - api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.SaasSubscriptionDetails].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SaasSubscriptionDetails]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_patch.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_patch.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/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/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_system_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_system_versions_operations.py deleted file mode 100644 index 776fe2e2ca24..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_system_versions_operations.py +++ /dev/null @@ -1,196 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._system_versions_operations import build_get_request, build_list_by_location_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SystemVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`system_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.SystemVersion"]: - """List SystemVersion resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either SystemVersion or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.SystemVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SystemVersionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SystemVersionListResult", 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(self, location: str, systemversionname: str, **kwargs: Any) -> _models.SystemVersion: - """Get a SystemVersion. - - :param location: The name of the Azure region. Required. - :type location: str - :param systemversionname: SystemVersion name. Required. - :type systemversionname: str - :return: SystemVersion or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.SystemVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SystemVersion] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - systemversionname=systemversionname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("SystemVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_virtual_network_addresses_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_virtual_network_addresses_operations.py deleted file mode 100644 index f4d1e4171c97..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_virtual_network_addresses_operations.py +++ /dev/null @@ -1,538 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._virtual_network_addresses_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_cloud_vm_cluster_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class VirtualNetworkAddressesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s - :attr:`virtual_network_addresses` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cloud_vm_cluster( - self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any - ) -> AsyncIterable["_models.VirtualNetworkAddress"]: - """List VirtualNetworkAddress resources by CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :return: An iterator like instance of either VirtualNetworkAddress or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualNetworkAddressListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_cloud_vm_cluster_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualNetworkAddressListResult", 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( - self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any - ) -> _models.VirtualNetworkAddress: - """Get a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: str - :return: VirtualNetworkAddress or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualNetworkAddress] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("VirtualNetworkAddress", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - virtualnetworkaddressname: str, - resource: Union[_models.VirtualNetworkAddress, IO[bytes]], - **kwargs: Any - ) -> _models.VirtualNetworkAddress: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualNetworkAddress] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "VirtualNetworkAddress") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - virtualnetworkaddressname: str, - resource: _models.VirtualNetworkAddress, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualNetworkAddress]: - """Create a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress - :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 VirtualNetworkAddress or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - virtualnetworkaddressname: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualNetworkAddress]: - """Create a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either VirtualNetworkAddress or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - virtualnetworkaddressname: str, - resource: Union[_models.VirtualNetworkAddress, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualNetworkAddress]: - """Create a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: str - :param resource: Resource create parameters. Is either a VirtualNetworkAddress type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress or IO[bytes] - :return: An instance of AsyncLROPoller that returns either VirtualNetworkAddress or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualNetworkAddress] = 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, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.VirtualNetworkAddress].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.VirtualNetworkAddress]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/__init__.py index 83423a5edb19..b8debffaa40e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/__init__.py @@ -2,175 +2,196 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import ActivationLinks -from ._models_py3 import AddRemoveDbNode -from ._models_py3 import AllConnectionStringType -from ._models_py3 import ApexDetailsType -from ._models_py3 import AutonomousDatabase -from ._models_py3 import AutonomousDatabaseBackup -from ._models_py3 import AutonomousDatabaseBackupListResult -from ._models_py3 import AutonomousDatabaseBackupProperties -from ._models_py3 import AutonomousDatabaseBackupUpdate -from ._models_py3 import AutonomousDatabaseBackupUpdateProperties -from ._models_py3 import AutonomousDatabaseBaseProperties -from ._models_py3 import AutonomousDatabaseCharacterSet -from ._models_py3 import AutonomousDatabaseCharacterSetListResult -from ._models_py3 import AutonomousDatabaseCharacterSetProperties -from ._models_py3 import AutonomousDatabaseCloneProperties -from ._models_py3 import AutonomousDatabaseListResult -from ._models_py3 import AutonomousDatabaseNationalCharacterSet -from ._models_py3 import AutonomousDatabaseNationalCharacterSetListResult -from ._models_py3 import AutonomousDatabaseNationalCharacterSetProperties -from ._models_py3 import AutonomousDatabaseProperties -from ._models_py3 import AutonomousDatabaseStandbySummary -from ._models_py3 import AutonomousDatabaseUpdate -from ._models_py3 import AutonomousDatabaseUpdateProperties -from ._models_py3 import AutonomousDatabaseWalletFile -from ._models_py3 import AutonomousDbVersion -from ._models_py3 import AutonomousDbVersionListResult -from ._models_py3 import AutonomousDbVersionProperties -from ._models_py3 import CloudAccountDetails -from ._models_py3 import CloudExadataInfrastructure -from ._models_py3 import CloudExadataInfrastructureListResult -from ._models_py3 import CloudExadataInfrastructureProperties -from ._models_py3 import CloudExadataInfrastructureUpdate -from ._models_py3 import CloudExadataInfrastructureUpdateProperties -from ._models_py3 import CloudVmCluster -from ._models_py3 import CloudVmClusterListResult -from ._models_py3 import CloudVmClusterProperties -from ._models_py3 import CloudVmClusterUpdate -from ._models_py3 import CloudVmClusterUpdateProperties -from ._models_py3 import ConnectionStringType -from ._models_py3 import ConnectionUrlType -from ._models_py3 import CustomerContact -from ._models_py3 import DataCollectionOptions -from ._models_py3 import DayOfWeek -from ._models_py3 import DayOfWeekUpdate -from ._models_py3 import DbIormConfig -from ._models_py3 import DbNode -from ._models_py3 import DbNodeAction -from ._models_py3 import DbNodeListResult -from ._models_py3 import DbNodeProperties -from ._models_py3 import DbServer -from ._models_py3 import DbServerListResult -from ._models_py3 import DbServerPatchingDetails -from ._models_py3 import DbServerProperties -from ._models_py3 import DbSystemShape -from ._models_py3 import DbSystemShapeListResult -from ._models_py3 import DbSystemShapeProperties -from ._models_py3 import DnsPrivateView -from ._models_py3 import DnsPrivateViewListResult -from ._models_py3 import DnsPrivateViewProperties -from ._models_py3 import DnsPrivateZone -from ._models_py3 import DnsPrivateZoneListResult -from ._models_py3 import DnsPrivateZoneProperties -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import EstimatedPatchingTime -from ._models_py3 import ExadataIormConfig -from ._models_py3 import GenerateAutonomousDatabaseWalletDetails -from ._models_py3 import GiVersion -from ._models_py3 import GiVersionListResult -from ._models_py3 import GiVersionProperties -from ._models_py3 import LongTermBackUpScheduleDetails -from ._models_py3 import MaintenanceWindow -from ._models_py3 import Month -from ._models_py3 import NsgCidr -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import OracleSubscription -from ._models_py3 import OracleSubscriptionListResult -from ._models_py3 import OracleSubscriptionProperties -from ._models_py3 import OracleSubscriptionUpdate -from ._models_py3 import OracleSubscriptionUpdateProperties -from ._models_py3 import PeerDbDetails -from ._models_py3 import Plan -from ._models_py3 import PlanUpdate -from ._models_py3 import PortRange -from ._models_py3 import PrivateIpAddressProperties -from ._models_py3 import PrivateIpAddressesFilter -from ._models_py3 import ProfileType -from ._models_py3 import ProxyResource -from ._models_py3 import Resource -from ._models_py3 import RestoreAutonomousDatabaseDetails -from ._models_py3 import SaasSubscriptionDetails -from ._models_py3 import ScheduledOperationsType -from ._models_py3 import ScheduledOperationsTypeUpdate -from ._models_py3 import SystemData -from ._models_py3 import SystemVersion -from ._models_py3 import SystemVersionListResult -from ._models_py3 import SystemVersionProperties -from ._models_py3 import SystemVersionsFilter -from ._models_py3 import TrackedResource -from ._models_py3 import ValidationError -from ._models_py3 import ValidationResult -from ._models_py3 import VirtualNetworkAddress -from ._models_py3 import VirtualNetworkAddressListResult -from ._models_py3 import VirtualNetworkAddressProperties +from typing import TYPE_CHECKING -from ._oracle_database_mgmt_client_enums import ActionType -from ._oracle_database_mgmt_client_enums import AutonomousDatabaseBackupLifecycleState -from ._oracle_database_mgmt_client_enums import AutonomousDatabaseBackupType -from ._oracle_database_mgmt_client_enums import AutonomousDatabaseLifecycleState -from ._oracle_database_mgmt_client_enums import AutonomousMaintenanceScheduleType -from ._oracle_database_mgmt_client_enums import AzureResourceProvisioningState -from ._oracle_database_mgmt_client_enums import CloneType -from ._oracle_database_mgmt_client_enums import CloudAccountProvisioningState -from ._oracle_database_mgmt_client_enums import CloudExadataInfrastructureLifecycleState -from ._oracle_database_mgmt_client_enums import CloudVmClusterLifecycleState -from ._oracle_database_mgmt_client_enums import ComputeModel -from ._oracle_database_mgmt_client_enums import ConsumerGroup -from ._oracle_database_mgmt_client_enums import CreatedByType -from ._oracle_database_mgmt_client_enums import DataBaseType -from ._oracle_database_mgmt_client_enums import DataSafeStatusType -from ._oracle_database_mgmt_client_enums import DatabaseEditionType -from ._oracle_database_mgmt_client_enums import DayOfWeekName -from ._oracle_database_mgmt_client_enums import DbNodeActionEnum -from ._oracle_database_mgmt_client_enums import DbNodeMaintenanceType -from ._oracle_database_mgmt_client_enums import DbNodeProvisioningState -from ._oracle_database_mgmt_client_enums import DbServerPatchingStatus -from ._oracle_database_mgmt_client_enums import DbServerProvisioningState -from ._oracle_database_mgmt_client_enums import DisasterRecoveryType -from ._oracle_database_mgmt_client_enums import DiskRedundancy -from ._oracle_database_mgmt_client_enums import DnsPrivateViewsLifecycleState -from ._oracle_database_mgmt_client_enums import DnsPrivateZonesLifecycleState -from ._oracle_database_mgmt_client_enums import GenerateType -from ._oracle_database_mgmt_client_enums import HostFormatType -from ._oracle_database_mgmt_client_enums import Intent -from ._oracle_database_mgmt_client_enums import IormLifecycleState -from ._oracle_database_mgmt_client_enums import LicenseModel -from ._oracle_database_mgmt_client_enums import MonthName -from ._oracle_database_mgmt_client_enums import Objective -from ._oracle_database_mgmt_client_enums import OpenModeType -from ._oracle_database_mgmt_client_enums import OperationsInsightsStatusType -from ._oracle_database_mgmt_client_enums import OracleSubscriptionProvisioningState -from ._oracle_database_mgmt_client_enums import Origin -from ._oracle_database_mgmt_client_enums import PatchingMode -from ._oracle_database_mgmt_client_enums import PermissionLevelType -from ._oracle_database_mgmt_client_enums import Preference -from ._oracle_database_mgmt_client_enums import ProtocolType -from ._oracle_database_mgmt_client_enums import RefreshableModelType -from ._oracle_database_mgmt_client_enums import RefreshableStatusType -from ._oracle_database_mgmt_client_enums import RepeatCadenceType -from ._oracle_database_mgmt_client_enums import ResourceProvisioningState -from ._oracle_database_mgmt_client_enums import RoleType -from ._oracle_database_mgmt_client_enums import SessionModeType -from ._oracle_database_mgmt_client_enums import SourceType -from ._oracle_database_mgmt_client_enums import SyntaxFormatType -from ._oracle_database_mgmt_client_enums import TlsAuthenticationType -from ._oracle_database_mgmt_client_enums import UpdateAction -from ._oracle_database_mgmt_client_enums import ValidationStatus -from ._oracle_database_mgmt_client_enums import VirtualNetworkAddressLifecycleState -from ._oracle_database_mgmt_client_enums import WorkloadType -from ._oracle_database_mgmt_client_enums import ZoneType +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + ActivationLinks, + AddRemoveDbNode, + AllConnectionStringType, + ApexDetailsType, + AutonomousDatabase, + AutonomousDatabaseBackup, + AutonomousDatabaseBackupProperties, + AutonomousDatabaseBackupUpdate, + AutonomousDatabaseBackupUpdateProperties, + AutonomousDatabaseBaseProperties, + AutonomousDatabaseCharacterSet, + AutonomousDatabaseCharacterSetProperties, + AutonomousDatabaseCloneProperties, + AutonomousDatabaseCrossRegionDisasterRecoveryProperties, + AutonomousDatabaseFromBackupTimestampProperties, + AutonomousDatabaseNationalCharacterSet, + AutonomousDatabaseNationalCharacterSetProperties, + AutonomousDatabaseProperties, + AutonomousDatabaseStandbySummary, + AutonomousDatabaseUpdate, + AutonomousDatabaseUpdateProperties, + AutonomousDatabaseWalletFile, + AutonomousDbVersion, + AutonomousDbVersionProperties, + AzureSubscriptions, + CloudAccountDetails, + CloudExadataInfrastructure, + CloudExadataInfrastructureProperties, + CloudExadataInfrastructureUpdate, + CloudExadataInfrastructureUpdateProperties, + CloudVmCluster, + CloudVmClusterProperties, + CloudVmClusterUpdate, + CloudVmClusterUpdateProperties, + ConnectionStringType, + ConnectionUrlType, + CustomerContact, + DataCollectionOptions, + DayOfWeek, + DayOfWeekUpdate, + DbActionResponse, + DbIormConfig, + DbNode, + DbNodeAction, + DbNodeDetails, + DbNodeProperties, + DbServer, + DbServerPatchingDetails, + DbServerProperties, + DbSystemShape, + DbSystemShapeProperties, + DefinedFileSystemConfiguration, + DisasterRecoveryConfigurationDetails, + DnsPrivateView, + DnsPrivateViewProperties, + DnsPrivateZone, + DnsPrivateZoneProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + EstimatedPatchingTime, + ExadataIormConfig, + ExadbVmCluster, + ExadbVmClusterProperties, + ExadbVmClusterStorageDetails, + ExadbVmClusterUpdate, + ExadbVmClusterUpdateProperties, + ExascaleDbNode, + ExascaleDbNodeProperties, + ExascaleDbStorageDetails, + ExascaleDbStorageInputDetails, + ExascaleDbStorageVault, + ExascaleDbStorageVaultProperties, + ExascaleDbStorageVaultTagsUpdate, + FileSystemConfigurationDetails, + FlexComponent, + FlexComponentProperties, + GenerateAutonomousDatabaseWalletDetails, + GiMinorVersion, + GiMinorVersionProperties, + GiVersion, + GiVersionProperties, + LongTermBackUpScheduleDetails, + MaintenanceWindow, + Month, + NsgCidr, + Operation, + OperationDisplay, + OracleSubscription, + OracleSubscriptionProperties, + OracleSubscriptionUpdate, + OracleSubscriptionUpdateProperties, + PeerDbDetails, + Plan, + PlanUpdate, + PortRange, + PrivateIpAddressProperties, + PrivateIpAddressesFilter, + ProfileType, + ProxyResource, + RemoveVirtualMachineFromExadbVmClusterDetails, + Resource, + RestoreAutonomousDatabaseDetails, + SaasSubscriptionDetails, + ScheduledOperationsType, + ScheduledOperationsTypeUpdate, + SystemData, + SystemVersion, + SystemVersionProperties, + TrackedResource, + VirtualNetworkAddress, + VirtualNetworkAddressProperties, +) + +from ._enums import ( # type: ignore + ActionType, + AddSubscriptionOperationState, + AutonomousDatabaseBackupLifecycleState, + AutonomousDatabaseBackupType, + AutonomousDatabaseLifecycleState, + AutonomousMaintenanceScheduleType, + AzureResourceProvisioningState, + CloneType, + CloudAccountProvisioningState, + CloudExadataInfrastructureLifecycleState, + CloudVmClusterLifecycleState, + ComputeModel, + ConsumerGroup, + CreatedByType, + DataBaseType, + DataSafeStatusType, + DatabaseEditionType, + DayOfWeekName, + DbNodeActionEnum, + DbNodeMaintenanceType, + DbNodeProvisioningState, + DbServerPatchingStatus, + DbServerProvisioningState, + DisasterRecoveryType, + DiskRedundancy, + DnsPrivateViewsLifecycleState, + DnsPrivateZonesLifecycleState, + ExadbVmClusterLifecycleState, + ExascaleDbStorageVaultLifecycleState, + GenerateType, + GridImageType, + HardwareType, + HostFormatType, + Intent, + IormLifecycleState, + LicenseModel, + MonthName, + Objective, + OpenModeType, + OperationsInsightsStatusType, + OracleSubscriptionProvisioningState, + Origin, + PatchingMode, + PermissionLevelType, + Preference, + ProtocolType, + RefreshableModelType, + RefreshableStatusType, + RepeatCadenceType, + ResourceProvisioningState, + RoleType, + SessionModeType, + ShapeFamily, + SourceType, + SyntaxFormatType, + SystemShapes, + TlsAuthenticationType, + VirtualNetworkAddressLifecycleState, + WorkloadType, + ZoneType, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -180,18 +201,16 @@ "ApexDetailsType", "AutonomousDatabase", "AutonomousDatabaseBackup", - "AutonomousDatabaseBackupListResult", "AutonomousDatabaseBackupProperties", "AutonomousDatabaseBackupUpdate", "AutonomousDatabaseBackupUpdateProperties", "AutonomousDatabaseBaseProperties", "AutonomousDatabaseCharacterSet", - "AutonomousDatabaseCharacterSetListResult", "AutonomousDatabaseCharacterSetProperties", "AutonomousDatabaseCloneProperties", - "AutonomousDatabaseListResult", + "AutonomousDatabaseCrossRegionDisasterRecoveryProperties", + "AutonomousDatabaseFromBackupTimestampProperties", "AutonomousDatabaseNationalCharacterSet", - "AutonomousDatabaseNationalCharacterSetListResult", "AutonomousDatabaseNationalCharacterSetProperties", "AutonomousDatabaseProperties", "AutonomousDatabaseStandbySummary", @@ -199,16 +218,14 @@ "AutonomousDatabaseUpdateProperties", "AutonomousDatabaseWalletFile", "AutonomousDbVersion", - "AutonomousDbVersionListResult", "AutonomousDbVersionProperties", + "AzureSubscriptions", "CloudAccountDetails", "CloudExadataInfrastructure", - "CloudExadataInfrastructureListResult", "CloudExadataInfrastructureProperties", "CloudExadataInfrastructureUpdate", "CloudExadataInfrastructureUpdateProperties", "CloudVmCluster", - "CloudVmClusterListResult", "CloudVmClusterProperties", "CloudVmClusterUpdate", "CloudVmClusterUpdateProperties", @@ -218,32 +235,47 @@ "DataCollectionOptions", "DayOfWeek", "DayOfWeekUpdate", + "DbActionResponse", "DbIormConfig", "DbNode", "DbNodeAction", - "DbNodeListResult", + "DbNodeDetails", "DbNodeProperties", "DbServer", - "DbServerListResult", "DbServerPatchingDetails", "DbServerProperties", "DbSystemShape", - "DbSystemShapeListResult", "DbSystemShapeProperties", + "DefinedFileSystemConfiguration", + "DisasterRecoveryConfigurationDetails", "DnsPrivateView", - "DnsPrivateViewListResult", "DnsPrivateViewProperties", "DnsPrivateZone", - "DnsPrivateZoneListResult", "DnsPrivateZoneProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", "EstimatedPatchingTime", "ExadataIormConfig", + "ExadbVmCluster", + "ExadbVmClusterProperties", + "ExadbVmClusterStorageDetails", + "ExadbVmClusterUpdate", + "ExadbVmClusterUpdateProperties", + "ExascaleDbNode", + "ExascaleDbNodeProperties", + "ExascaleDbStorageDetails", + "ExascaleDbStorageInputDetails", + "ExascaleDbStorageVault", + "ExascaleDbStorageVaultProperties", + "ExascaleDbStorageVaultTagsUpdate", + "FileSystemConfigurationDetails", + "FlexComponent", + "FlexComponentProperties", "GenerateAutonomousDatabaseWalletDetails", + "GiMinorVersion", + "GiMinorVersionProperties", "GiVersion", - "GiVersionListResult", "GiVersionProperties", "LongTermBackUpScheduleDetails", "MaintenanceWindow", @@ -251,9 +283,7 @@ "NsgCidr", "Operation", "OperationDisplay", - "OperationListResult", "OracleSubscription", - "OracleSubscriptionListResult", "OracleSubscriptionProperties", "OracleSubscriptionUpdate", "OracleSubscriptionUpdateProperties", @@ -265,6 +295,7 @@ "PrivateIpAddressesFilter", "ProfileType", "ProxyResource", + "RemoveVirtualMachineFromExadbVmClusterDetails", "Resource", "RestoreAutonomousDatabaseDetails", "SaasSubscriptionDetails", @@ -272,16 +303,12 @@ "ScheduledOperationsTypeUpdate", "SystemData", "SystemVersion", - "SystemVersionListResult", "SystemVersionProperties", - "SystemVersionsFilter", "TrackedResource", - "ValidationError", - "ValidationResult", "VirtualNetworkAddress", - "VirtualNetworkAddressListResult", "VirtualNetworkAddressProperties", "ActionType", + "AddSubscriptionOperationState", "AutonomousDatabaseBackupLifecycleState", "AutonomousDatabaseBackupType", "AutonomousDatabaseLifecycleState", @@ -307,7 +334,11 @@ "DiskRedundancy", "DnsPrivateViewsLifecycleState", "DnsPrivateZonesLifecycleState", + "ExadbVmClusterLifecycleState", + "ExascaleDbStorageVaultLifecycleState", "GenerateType", + "GridImageType", + "HardwareType", "HostFormatType", "Intent", "IormLifecycleState", @@ -328,14 +359,14 @@ "ResourceProvisioningState", "RoleType", "SessionModeType", + "ShapeFamily", "SourceType", "SyntaxFormatType", + "SystemShapes", "TlsAuthenticationType", - "UpdateAction", - "ValidationStatus", "VirtualNetworkAddressLifecycleState", "WorkloadType", "ZoneType", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_oracle_database_mgmt_client_enums.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_enums.py similarity index 84% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_oracle_database_mgmt_client_enums.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_enums.py index 4b7f8e25139e..c49c5842a583 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_oracle_database_mgmt_client_enums.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_enums.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -11,9 +11,23 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" + """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + only APIs. + """ INTERNAL = "Internal" + """Actions are for internal-only APIs.""" + + +class AddSubscriptionOperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Add Subscription Operation state enum.""" + + SUCCEEDED = "Succeeded" + """Succeeded - State when Add Subscription operation succeeded""" + UPDATING = "Updating" + """Updating - State when Add Subscription operation is being Updated""" + FAILED = "Failed" + """Failed - State when Add Subscription operation failed""" class AutonomousDatabaseBackupLifecycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -194,12 +208,16 @@ class ConsumerGroup(str, Enum, metaclass=CaseInsensitiveEnumMeta): class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" + """The kind of entity that created the resource.""" USER = "User" + """The entity was created by a user.""" APPLICATION = "Application" + """The entity was created by an application.""" MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" KEY = "Key" + """The entity was created by a key.""" class DatabaseEditionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -218,6 +236,10 @@ class DataBaseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Regular DB""" CLONE = "Clone" """Clone DB""" + CLONE_FROM_BACKUP_TIMESTAMP = "CloneFromBackupTimestamp" + """Clone DB from backup timestamp""" + CROSS_REGION_DISASTER_RECOVERY = "CrossRegionDisasterRecovery" + """Cross Region Disaster Recovery""" class DataSafeStatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -373,6 +395,42 @@ class DnsPrivateZonesLifecycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta """DNS Private Zones is updating""" +class ExadbVmClusterLifecycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Exadata VM cluster on Exascale Infrastructure lifecycle state enum.""" + + PROVISIONING = "Provisioning" + """Indicates that resource in Provisioning state""" + AVAILABLE = "Available" + """Indicates that resource in Available state""" + UPDATING = "Updating" + """Indicates that resource in Updating state""" + TERMINATING = "Terminating" + """Indicates that resource in Terminating state""" + TERMINATED = "Terminated" + """Indicates that resource in Terminated state""" + MAINTENANCE_IN_PROGRESS = "MaintenanceInProgress" + """Indicates that resource Maintenance in progress state""" + FAILED = "Failed" + """Indicates that resource in Failed state""" + + +class ExascaleDbStorageVaultLifecycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Exadata Database Storage Vault lifecycle state enum.""" + + PROVISIONING = "Provisioning" + """Indicates that resource in Provisioning state""" + AVAILABLE = "Available" + """Indicates that resource in Available state""" + UPDATING = "Updating" + """Indicates that resource in Updating state""" + TERMINATING = "Terminating" + """Indicates that resource in Terminating state""" + TERMINATED = "Terminated" + """Indicates that resource in Terminated state""" + FAILED = "Failed" + """Indicates that resource in Failed state""" + + class GenerateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Generate type enum.""" @@ -382,6 +440,24 @@ class GenerateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Generate all""" +class GridImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """GridImageType enum.""" + + RELEASE_UPDATE = "ReleaseUpdate" + """Release update""" + CUSTOM_IMAGE = "CustomImage" + """Custom image""" + + +class HardwareType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Hardware Type enum.""" + + COMPUTE = "COMPUTE" + """Hardware type is Database Server""" + CELL = "CELL" + """Hardware type is Storage Server""" + + class HostFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Host format type enum.""" @@ -511,8 +587,11 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ USER = "user" + """Indicates the operation is initiated by a user.""" SYSTEM = "system" + """Indicates the operation is initiated by a system.""" USER_SYSTEM = "user,system" + """Indicates the operation is initiated by a user or system.""" class PatchingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -617,6 +696,15 @@ class SessionModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Redirect session mode""" +class ShapeFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Allowed values for GI Minor Versions shapeFamily filter.""" + + EXADATA = "EXADATA" + """Family value for Exadata Shape""" + EXADB_XS = "EXADB_XS" + """Family value for Exadb XS Shape""" + + class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Source type enum.""" @@ -647,6 +735,17 @@ class SyntaxFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Ezconnectplus format""" +class SystemShapes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Allowed values for System Shapes.""" + + EXADATA_X9_M = "Exadata.X9M" + """Exadata X9M shape""" + EXADATA_X11_M = "Exadata.X11M" + """Exadata X11M shape""" + EXA_DB_XS = "ExaDbXS" + """Exadata DB on Exascale Infrastructure shape""" + + class TlsAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """TLS authentication type enum.""" @@ -656,28 +755,6 @@ class TlsAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Mutual TLS""" -class UpdateAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Update action enum.""" - - ROLLING_APPLY = "RollingApply" - """Rolling apply action""" - NON_ROLLING_APPLY = "NonRollingApply" - """Non rolling apply action""" - PRE_CHECK = "PreCheck" - """Pre-check action""" - ROLL_BACK = "RollBack" - """Rollback action""" - - -class ValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """validation status.""" - - SUCCEEDED = "Succeeded" - """Validation succeeded""" - FAILED = "Failed" - """Validation failed""" - - class VirtualNetworkAddressLifecycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """VirtualNetworkAddressLifecycleState enum.""" diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models.py new file mode 100644 index 000000000000..88591176c5d9 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models.py @@ -0,0 +1,7904 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_discriminator, rest_field +from ._enums import DataBaseType, SourceType + +if TYPE_CHECKING: + from .. import models as _models + + +class ActivationLinks(_Model): + """Activation Links model. + + :ivar new_cloud_account_activation_link: New Cloud Account Activation Link. + :vartype new_cloud_account_activation_link: str + :ivar existing_cloud_account_activation_link: Existing Cloud Account Activation Link. + :vartype existing_cloud_account_activation_link: str + """ + + new_cloud_account_activation_link: Optional[str] = rest_field( + name="newCloudAccountActivationLink", visibility=["read"] + ) + """New Cloud Account Activation Link.""" + existing_cloud_account_activation_link: Optional[str] = rest_field( + name="existingCloudAccountActivationLink", visibility=["read"] + ) + """Existing Cloud Account Activation Link.""" + + +class AddRemoveDbNode(_Model): + """Add/Remove (Virtual Machine) DbNode model. + + :ivar db_servers: Db servers ocids. Required. + :vartype db_servers: list[str] + """ + + db_servers: List[str] = rest_field(name="dbServers", visibility=["read", "create", "update", "delete", "query"]) + """Db servers ocids. Required.""" + + @overload + def __init__( + self, + *, + db_servers: List[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AllConnectionStringType(_Model): + """The connection string profile to allow clients to group, filter and select connection string + values based on structured metadata. + + :ivar high: The High database service provides the highest level of resources to each SQL + statement resulting in the highest performance, but supports the fewest number of concurrent + SQL statements. + :vartype high: str + :ivar low: The Low database service provides the least level of resources to each SQL + statement, but supports the most number of concurrent SQL statements. + :vartype low: str + :ivar medium: The Medium database service provides a lower level of resources to each SQL + statement potentially resulting a lower level of performance, but supports more concurrent SQL + statements. + :vartype medium: str + """ + + high: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The High database service provides the highest level of resources to each SQL statement + resulting in the highest performance, but supports the fewest number of concurrent SQL + statements.""" + low: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Low database service provides the least level of resources to each SQL statement, but + supports the most number of concurrent SQL statements.""" + medium: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Medium database service provides a lower level of resources to each SQL statement + potentially resulting a lower level of performance, but supports more concurrent SQL + statements.""" + + @overload + def __init__( + self, + *, + high: Optional[str] = None, + low: Optional[str] = None, + medium: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ApexDetailsType(_Model): + """Information about Oracle APEX Application Development. + + :ivar apex_version: The Oracle APEX Application Development version. + :vartype apex_version: str + :ivar ords_version: The Oracle REST Data Services (ORDS) version. + :vartype ords_version: str + """ + + apex_version: Optional[str] = rest_field( + name="apexVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The Oracle APEX Application Development version.""" + ords_version: Optional[str] = rest_field( + name="ordsVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The Oracle REST Data Services (ORDS) version.""" + + @overload + def __init__( + self, + *, + apex_version: Optional[str] = None, + ords_version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabase(TrackedResource): + """Autonomous Database resource model. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBaseProperties + """ + + properties: Optional["_models.AutonomousDatabaseBaseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.AutonomousDatabaseBaseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + """ + + +class AutonomousDatabaseBackup(ProxyResource): + """AutonomousDatabaseBackup resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupProperties + """ + + properties: Optional["_models.AutonomousDatabaseBackupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.AutonomousDatabaseBackupProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseBackupProperties(_Model): + """AutonomousDatabaseBackup resource model. + + :ivar autonomous_database_ocid: The OCID of the Autonomous Database. + :vartype autonomous_database_ocid: str + :ivar database_size_in_tbs: The size of the database in terabytes at the time the backup was + taken. + :vartype database_size_in_tbs: float + :ivar db_version: A valid Oracle Database version for Autonomous Database. + :vartype db_version: str + :ivar display_name: The user-friendly name for the backup. The name does not have to be unique. + :vartype display_name: str + :ivar ocid: The OCID of the Autonomous Database backup. + :vartype ocid: str + :ivar is_automatic: Indicates whether the backup is user-initiated or automatic. + :vartype is_automatic: bool + :ivar is_restorable: Indicates whether the backup can be used to restore the associated + Autonomous Database. + :vartype is_restorable: bool + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar lifecycle_state: The current state of the backup. Known values are: "Creating", "Active", + "Deleting", "Failed", and "Updating". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupLifecycleState + :ivar retention_period_in_days: Retention period, in days. + :vartype retention_period_in_days: int + :ivar size_in_tbs: The backup size in terabytes (TB). + :vartype size_in_tbs: float + :ivar time_available_til: Timestamp until when the backup will be available. + :vartype time_available_til: ~datetime.datetime + :ivar time_started: The date and time the backup started. + :vartype time_started: str + :ivar time_ended: The date and time the backup completed. + :vartype time_ended: str + :ivar backup_type: The type of backup. Known values are: "Incremental", "Full", and "LongTerm". + :vartype backup_type: str or ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupType + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + """ + + autonomous_database_ocid: Optional[str] = rest_field(name="autonomousDatabaseOcid", visibility=["read"]) + """The OCID of the Autonomous Database.""" + database_size_in_tbs: Optional[float] = rest_field(name="databaseSizeInTbs", visibility=["read"]) + """The size of the database in terabytes at the time the backup was taken.""" + db_version: Optional[str] = rest_field(name="dbVersion", visibility=["read"]) + """A valid Oracle Database version for Autonomous Database.""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read", "create"]) + """The user-friendly name for the backup. The name does not have to be unique.""" + ocid: Optional[str] = rest_field(visibility=["read"]) + """The OCID of the Autonomous Database backup.""" + is_automatic: Optional[bool] = rest_field(name="isAutomatic", visibility=["read"]) + """Indicates whether the backup is user-initiated or automatic.""" + is_restorable: Optional[bool] = rest_field(name="isRestorable", visibility=["read"]) + """Indicates whether the backup can be used to restore the associated Autonomous Database.""" + lifecycle_details: Optional[str] = rest_field(name="lifecycleDetails", visibility=["read"]) + """Additional information about the current lifecycle state.""" + lifecycle_state: Optional[Union[str, "_models.AutonomousDatabaseBackupLifecycleState"]] = rest_field( + name="lifecycleState", visibility=["read"] + ) + """The current state of the backup. Known values are: \"Creating\", \"Active\", \"Deleting\", + \"Failed\", and \"Updating\".""" + retention_period_in_days: Optional[int] = rest_field( + name="retentionPeriodInDays", visibility=["read", "create", "update"] + ) + """Retention period, in days.""" + size_in_tbs: Optional[float] = rest_field(name="sizeInTbs", visibility=["read"]) + """The backup size in terabytes (TB).""" + time_available_til: Optional[datetime.datetime] = rest_field( + name="timeAvailableTil", visibility=["read"], format="rfc3339" + ) + """Timestamp until when the backup will be available.""" + time_started: Optional[str] = rest_field(name="timeStarted", visibility=["read"]) + """The date and time the backup started.""" + time_ended: Optional[str] = rest_field(name="timeEnded", visibility=["read"]) + """The date and time the backup completed.""" + backup_type: Optional[Union[str, "_models.AutonomousDatabaseBackupType"]] = rest_field( + name="backupType", visibility=["read"] + ) + """The type of backup. Known values are: \"Incremental\", \"Full\", and \"LongTerm\".""" + provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Azure resource provisioning state. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + and \"Provisioning\".""" + + @overload + def __init__( + self, + *, + display_name: Optional[str] = None, + retention_period_in_days: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseBackupUpdate(_Model): + """The type used for update operations of the AutonomousDatabaseBackup. + + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdateProperties + """ + + properties: Optional["_models.AutonomousDatabaseBackupUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.AutonomousDatabaseBackupUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseBackupUpdateProperties(_Model): + """The updatable properties of the AutonomousDatabaseBackup. + + :ivar retention_period_in_days: Retention period, in days. + :vartype retention_period_in_days: int + """ + + retention_period_in_days: Optional[int] = rest_field( + name="retentionPeriodInDays", visibility=["read", "create", "update"] + ) + """Retention period, in days.""" + + @overload + def __init__( + self, + *, + retention_period_in_days: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseBaseProperties(_Model): + """Autonomous Database base resource model. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AutonomousDatabaseCloneProperties, AutonomousDatabaseFromBackupTimestampProperties, + AutonomousDatabaseCrossRegionDisasterRecoveryProperties, AutonomousDatabaseProperties + + :ivar admin_password: Admin password. + :vartype admin_password: str + :ivar data_base_type: Database type to be created. Required. Known values are: "Regular", + "Clone", "CloneFromBackupTimestamp", and "CrossRegionDisasterRecovery". + :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.DataBaseType + :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :vartype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :ivar character_set: The character set for the autonomous database. + :vartype character_set: str + :ivar compute_count: The compute amount (CPUs) available to the database. + :vartype compute_count: float + :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and + "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :ivar cpu_core_count: The number of CPU cores to be made available to the database. + :vartype cpu_core_count: int + :ivar customer_contacts: Customer Contacts. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :vartype data_storage_size_in_tbs: int + :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created + and attached to the database. + :vartype data_storage_size_in_gbs: int + :ivar db_version: A valid Oracle Database version for Autonomous Database. + :vartype db_version: str + :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :ivar display_name: The user-friendly name for the Autonomous Database. + :vartype display_name: str + :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database + CPU core count. + :vartype is_auto_scaling_enabled: bool + :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :vartype is_auto_scaling_for_storage_enabled: bool + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. + :vartype peer_db_ids: list[str] + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :vartype peer_db_id: str + :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :vartype is_local_data_guard_enabled: bool + :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region + Data Guard enabled. + :vartype is_remote_data_guard_enabled: bool + :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the + Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business + critical DR with a faster recovery time objective (RTO) during failover or + switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Known values are: "Adg" and "BackupBased". + :vartype local_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. + :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary + :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data + Guard failover. + :vartype failed_data_recovery_in_seconds: int + :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :vartype is_mtls_connection_required: bool + :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database + preview version is being provisioned. + :vartype is_preview_version_with_service_terms_accepted: bool + :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. + The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar ncharacter_set: The character set for the Autonomous Database. + :vartype ncharacter_set: str + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", + "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", + "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState + :ivar scheduled_operations: The list of scheduled operations. + :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType + :ivar private_endpoint_ip: The private endpoint Ip address for the resource. + :vartype private_endpoint_ip: str + :ivar private_endpoint_label: The resource's private endpoint label. + :vartype private_endpoint_label: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar subnet_id: Client subnet. + :vartype subnet_id: str + :ivar vnet_id: VNET for network connectivity. + :vartype vnet_id: str + :ivar time_created: The date and time that the database was created. + :vartype time_created: ~datetime.datetime + :ivar time_maintenance_begin: The date and time when maintenance will begin. + :vartype time_maintenance_begin: ~datetime.datetime + :ivar time_maintenance_end: The date and time when maintenance will end. + :vartype time_maintenance_end: ~datetime.datetime + :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and + system data, in terabytes (TB). + :vartype actual_used_data_storage_size_in_tbs: float + :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database + tables and billed for, rounded up. + :vartype allocated_storage_size_in_tbs: float + :ivar apex_details: Information about Oracle APEX Application Development. + :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType + :ivar available_upgrade_versions: List of Oracle Database versions available for a database + upgrade. If there are no version upgrades available, this list is empty. + :vartype available_upgrade_versions: list[str] + :ivar connection_strings: The connection string used to connect to the Autonomous Database. + :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType + :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL + Developer Web with a browser from a Compute instance within your VCN or that has a direct + connection to your VCN. + :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType + :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. + Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". + :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType + :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. + Known values are: "StandardEdition" and "EnterpriseEdition". + :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :ivar autonomous_database_id: Autonomous Database ID. + :vartype autonomous_database_id: str + :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. + :vartype in_memory_area_in_gbs: int + :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would + be created. + :vartype next_long_term_backup_time_stamp: ~datetime.datetime + :ivar long_term_backup_schedule: Details for the long-term backup schedule. + :vartype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :ivar is_preview: Indicates if the Autonomous Database version is a preview version. + :vartype is_preview: bool + :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :vartype local_adg_auto_failover_max_data_loss_limit: int + :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or + OCPU. + :vartype memory_per_oracle_compute_unit_in_gbs: int + :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. + Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and + "FailedDisabling". + :vartype operations_insights_status: str or + ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType + :ivar permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :ivar private_endpoint: The private endpoint for the resource. + :vartype private_endpoint: str + :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. + :vartype provisionable_cpus: list[int] + :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if + Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :ivar service_console_url: The URL of the Service Console for the Autonomous Database. + :vartype service_console_url: str + :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. + :vartype sql_web_developer_url: str + :ivar supported_regions_to_clone_to: The list of regions that support the creation of an + Autonomous Database clone or an Autonomous Data Guard standby database. + :vartype supported_regions_to_clone_to: list[str] + :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the Autonomous Database. + :vartype time_data_guard_role_changed: str + :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database + will be automatically deleted because of inactivity. + :vartype time_deletion_of_free_autonomous_database: str + :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled + for an Autonomous Database where the standby was provisioned in the same region as the primary + database. + :vartype time_local_data_guard_enabled: str + :ivar time_of_last_failover: The timestamp of the last failover operation. + :vartype time_of_last_failover: str + :ivar time_of_last_refresh: The date and time when last refresh happened. + :vartype time_of_last_refresh: str + :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). + :vartype time_of_last_refresh_point: str + :ivar time_of_last_switchover: The timestamp of the last switchover operation for the + Autonomous Database. + :vartype time_of_last_switchover: str + :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database + will be stopped because of inactivity. + :vartype time_reclamation_of_free_autonomous_database: str + :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. + :vartype used_data_storage_size_in_gbs: int + :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. + :vartype used_data_storage_size_in_tbs: int + :ivar ocid: Database ocid. + :vartype ocid: str + :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. + :vartype backup_retention_period_in_days: int + :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :vartype whitelisted_ips: list[str] + """ + + __mapping__: Dict[str, _Model] = {} + admin_password: Optional[str] = rest_field(name="adminPassword", visibility=["create", "update"]) + """Admin password.""" + data_base_type: str = rest_discriminator(name="dataBaseType", visibility=["create"]) + """Database type to be created. Required. Known values are: \"Regular\", \"Clone\", + \"CloneFromBackupTimestamp\", and \"CrossRegionDisasterRecovery\".""" + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = ( + rest_field(name="autonomousMaintenanceScheduleType", visibility=["read", "create", "update"]) + ) + """The maintenance schedule type of the Autonomous Database Serverless. Known values are: + \"Early\" and \"Regular\".""" + character_set: Optional[str] = rest_field(name="characterSet", visibility=["read", "create"]) + """The character set for the autonomous database.""" + compute_count: Optional[float] = rest_field(name="computeCount", visibility=["read", "create", "update"]) + """The compute amount (CPUs) available to the database.""" + compute_model: Optional[Union[str, "_models.ComputeModel"]] = rest_field( + name="computeModel", visibility=["read", "create"] + ) + """The compute model of the Autonomous Database. Known values are: \"ECPU\" and \"OCPU\".""" + cpu_core_count: Optional[int] = rest_field(name="cpuCoreCount", visibility=["read", "create", "update"]) + """The number of CPU cores to be made available to the database.""" + customer_contacts: Optional[List["_models.CustomerContact"]] = rest_field( + name="customerContacts", visibility=["read", "create", "update"] + ) + """Customer Contacts.""" + data_storage_size_in_tbs: Optional[int] = rest_field( + name="dataStorageSizeInTbs", visibility=["read", "create", "update"] + ) + """The quantity of data in the database, in terabytes.""" + data_storage_size_in_gbs: Optional[int] = rest_field( + name="dataStorageSizeInGbs", visibility=["read", "create", "update"] + ) + """The size, in gigabytes, of the data volume that will be created and attached to the database.""" + db_version: Optional[str] = rest_field(name="dbVersion", visibility=["read", "create"]) + """A valid Oracle Database version for Autonomous Database.""" + db_workload: Optional[Union[str, "_models.WorkloadType"]] = rest_field( + name="dbWorkload", visibility=["read", "create"] + ) + """The Autonomous Database workload type. Known values are: \"OLTP\", \"DW\", \"AJD\", and + \"APEX\".""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read", "create", "update"]) + """The user-friendly name for the Autonomous Database.""" + is_auto_scaling_enabled: Optional[bool] = rest_field( + name="isAutoScalingEnabled", visibility=["read", "create", "update"] + ) + """Indicates if auto scaling is enabled for the Autonomous Database CPU core count.""" + is_auto_scaling_for_storage_enabled: Optional[bool] = rest_field( + name="isAutoScalingForStorageEnabled", visibility=["read", "create", "update"] + ) + """Indicates if auto scaling is enabled for the Autonomous Database storage.""" + peer_db_ids: Optional[List[str]] = rest_field(name="peerDbIds", visibility=["read"]) + """The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote + regions that are associated with the source database. Note that for Autonomous Database + Serverless instances, standby databases located in the same region as the source primary + database do not have Azure IDs.""" + peer_db_id: Optional[str] = rest_field(name="peerDbId", visibility=["update"]) + """The Azure resource ID of the Disaster Recovery peer database, which is located in a different + region from the current peer database.""" + is_local_data_guard_enabled: Optional[bool] = rest_field( + name="isLocalDataGuardEnabled", visibility=["read", "create", "update"] + ) + """Indicates whether the Autonomous Database has local or called in-region Data Guard enabled.""" + is_remote_data_guard_enabled: Optional[bool] = rest_field(name="isRemoteDataGuardEnabled", visibility=["read"]) + """Indicates whether the Autonomous Database has Cross Region Data Guard enabled.""" + local_disaster_recovery_type: Optional[Union[str, "_models.DisasterRecoveryType"]] = rest_field( + name="localDisasterRecoveryType", visibility=["read"] + ) + """Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless + instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster + recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower + cost DR with a slower RTO during failover or switchover. Known values are: \"Adg\" and + \"BackupBased\".""" + time_disaster_recovery_role_changed: Optional[datetime.datetime] = rest_field( + name="timeDisasterRecoveryRoleChanged", visibility=["read"], format="rfc3339" + ) + """The date and time the Disaster Recovery role was switched for the standby Autonomous Database.""" + remote_disaster_recovery_configuration: Optional["_models.DisasterRecoveryConfigurationDetails"] = rest_field( + name="remoteDisasterRecoveryConfiguration", visibility=["read"] + ) + """Indicates remote disaster recovery configuration.""" + local_standby_db: Optional["_models.AutonomousDatabaseStandbySummary"] = rest_field( + name="localStandbyDb", visibility=["read"] + ) + """Local Autonomous Disaster Recovery standby database details.""" + failed_data_recovery_in_seconds: Optional[int] = rest_field(name="failedDataRecoveryInSeconds", visibility=["read"]) + """Indicates the number of seconds of data loss for a Data Guard failover.""" + is_mtls_connection_required: Optional[bool] = rest_field( + name="isMtlsConnectionRequired", visibility=["read", "create", "update"] + ) + """Specifies if the Autonomous Database requires mTLS connections.""" + is_preview_version_with_service_terms_accepted: Optional[bool] = rest_field( + name="isPreviewVersionWithServiceTermsAccepted", visibility=["create"] + ) + """Specifies if the Autonomous Database preview version is being provisioned.""" + license_model: Optional[Union[str, "_models.LicenseModel"]] = rest_field( + name="licenseModel", visibility=["read", "create", "update"] + ) + """The Oracle license model that applies to the Oracle Autonomous Database. The default is + LICENSE_INCLUDED. Known values are: \"LicenseIncluded\" and \"BringYourOwnLicense\".""" + ncharacter_set: Optional[str] = rest_field(name="ncharacterSet", visibility=["read", "create"]) + """The character set for the Autonomous Database.""" + lifecycle_details: Optional[str] = rest_field(name="lifecycleDetails", visibility=["read"]) + """Additional information about the current lifecycle state.""" + provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Azure resource provisioning state. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + and \"Provisioning\".""" + lifecycle_state: Optional[Union[str, "_models.AutonomousDatabaseLifecycleState"]] = rest_field( + name="lifecycleState", visibility=["read"] + ) + """Views lifecycleState. Known values are: \"Provisioning\", \"Available\", \"Stopping\", + \"Stopped\", \"Starting\", \"Terminating\", \"Terminated\", \"Unavailable\", + \"RestoreInProgress\", \"RestoreFailed\", \"BackupInProgress\", \"ScaleInProgress\", + \"AvailableNeedsAttention\", \"Updating\", \"MaintenanceInProgress\", \"Restarting\", + \"Recreating\", \"RoleChangeInProgress\", \"Upgrading\", \"Inaccessible\", and \"Standby\".""" + scheduled_operations: Optional["_models.ScheduledOperationsType"] = rest_field( + name="scheduledOperations", visibility=["read", "create", "update"] + ) + """The list of scheduled operations.""" + private_endpoint_ip: Optional[str] = rest_field(name="privateEndpointIp", visibility=["read", "create"]) + """The private endpoint Ip address for the resource.""" + private_endpoint_label: Optional[str] = rest_field(name="privateEndpointLabel", visibility=["read", "create"]) + """The resource's private endpoint label.""" + oci_url: Optional[str] = rest_field(name="ociUrl", visibility=["read"]) + """HTTPS link to OCI resources exposed to Azure Customer via Azure Interface.""" + subnet_id: Optional[str] = rest_field(name="subnetId", visibility=["read", "create"]) + """Client subnet.""" + vnet_id: Optional[str] = rest_field(name="vnetId", visibility=["read", "create"]) + """VNET for network connectivity.""" + time_created: Optional[datetime.datetime] = rest_field(name="timeCreated", visibility=["read"], format="rfc3339") + """The date and time that the database was created.""" + time_maintenance_begin: Optional[datetime.datetime] = rest_field( + name="timeMaintenanceBegin", visibility=["read"], format="rfc3339" + ) + """The date and time when maintenance will begin.""" + time_maintenance_end: Optional[datetime.datetime] = rest_field( + name="timeMaintenanceEnd", visibility=["read"], format="rfc3339" + ) + """The date and time when maintenance will end.""" + actual_used_data_storage_size_in_tbs: Optional[float] = rest_field( + name="actualUsedDataStorageSizeInTbs", visibility=["read"] + ) + """The current amount of storage in use for user and system data, in terabytes (TB).""" + allocated_storage_size_in_tbs: Optional[float] = rest_field(name="allocatedStorageSizeInTbs", visibility=["read"]) + """The amount of storage currently allocated for the database tables and billed for, rounded up.""" + apex_details: Optional["_models.ApexDetailsType"] = rest_field(name="apexDetails", visibility=["read"]) + """Information about Oracle APEX Application Development.""" + available_upgrade_versions: Optional[List[str]] = rest_field(name="availableUpgradeVersions", visibility=["read"]) + """List of Oracle Database versions available for a database upgrade. If there are no version + upgrades available, this list is empty.""" + connection_strings: Optional["_models.ConnectionStringType"] = rest_field( + name="connectionStrings", visibility=["read"] + ) + """The connection string used to connect to the Autonomous Database.""" + connection_urls: Optional["_models.ConnectionUrlType"] = rest_field(name="connectionUrls", visibility=["read"]) + """The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser + from a Compute instance within your VCN or that has a direct connection to your VCN.""" + data_safe_status: Optional[Union[str, "_models.DataSafeStatusType"]] = rest_field( + name="dataSafeStatus", visibility=["read"] + ) + """Status of the Data Safe registration for this Autonomous Database. Known values are: + \"Registering\", \"Registered\", \"Deregistering\", \"NotRegistered\", and \"Failed\".""" + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = rest_field( + name="databaseEdition", visibility=["read", "create", "update"] + ) + """The Oracle Database Edition that applies to the Autonomous databases. Known values are: + \"StandardEdition\" and \"EnterpriseEdition\".""" + autonomous_database_id: Optional[str] = rest_field(name="autonomousDatabaseId", visibility=["read", "create"]) + """Autonomous Database ID.""" + in_memory_area_in_gbs: Optional[int] = rest_field(name="inMemoryAreaInGbs", visibility=["read"]) + """The area assigned to In-Memory tables in Autonomous Database.""" + next_long_term_backup_time_stamp: Optional[datetime.datetime] = rest_field( + name="nextLongTermBackupTimeStamp", visibility=["read"], format="rfc3339" + ) + """The date and time when the next long-term backup would be created.""" + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = rest_field( + name="longTermBackupSchedule", visibility=["read", "update"] + ) + """Details for the long-term backup schedule.""" + is_preview: Optional[bool] = rest_field(name="isPreview", visibility=["read"]) + """Indicates if the Autonomous Database version is a preview version.""" + local_adg_auto_failover_max_data_loss_limit: Optional[int] = rest_field( + name="localAdgAutoFailoverMaxDataLossLimit", visibility=["read", "update"] + ) + """Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to + which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard.""" + memory_per_oracle_compute_unit_in_gbs: Optional[int] = rest_field( + name="memoryPerOracleComputeUnitInGbs", visibility=["read"] + ) + """The amount of memory (in GBs) enabled per ECPU or OCPU.""" + open_mode: Optional[Union[str, "_models.OpenModeType"]] = rest_field(name="openMode", visibility=["read", "update"]) + """Indicates the Autonomous Database mode. Known values are: \"ReadOnly\" and \"ReadWrite\".""" + operations_insights_status: Optional[Union[str, "_models.OperationsInsightsStatusType"]] = rest_field( + name="operationsInsightsStatus", visibility=["read"] + ) + """Status of Operations Insights for this Autonomous Database. Known values are: \"Enabling\", + \"Enabled\", \"Disabling\", \"NotEnabled\", \"FailedEnabling\", and \"FailedDisabling\".""" + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = rest_field( + name="permissionLevel", visibility=["read", "update"] + ) + """The Autonomous Database permission level. Known values are: \"Restricted\" and + \"Unrestricted\".""" + private_endpoint: Optional[str] = rest_field(name="privateEndpoint", visibility=["read"]) + """The private endpoint for the resource.""" + provisionable_cpus: Optional[List[int]] = rest_field(name="provisionableCpus", visibility=["read"]) + """An array of CPU values that an Autonomous Database can be scaled to.""" + role: Optional[Union[str, "_models.RoleType"]] = rest_field(visibility=["read", "update"]) + """The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous + Data Guard is enabled. Known values are: \"Primary\", \"Standby\", \"DisabledStandby\", + \"BackupCopy\", and \"SnapshotStandby\".""" + service_console_url: Optional[str] = rest_field(name="serviceConsoleUrl", visibility=["read"]) + """The URL of the Service Console for the Autonomous Database.""" + sql_web_developer_url: Optional[str] = rest_field(name="sqlWebDeveloperUrl", visibility=["read"]) + """The SQL Web Developer URL for the Oracle Autonomous Database.""" + supported_regions_to_clone_to: Optional[List[str]] = rest_field( + name="supportedRegionsToCloneTo", visibility=["read"] + ) + """The list of regions that support the creation of an Autonomous Database clone or an Autonomous + Data Guard standby database.""" + time_data_guard_role_changed: Optional[str] = rest_field(name="timeDataGuardRoleChanged", visibility=["read"]) + """The date and time the Autonomous Data Guard role was switched for the Autonomous Database.""" + time_deletion_of_free_autonomous_database: Optional[str] = rest_field( + name="timeDeletionOfFreeAutonomousDatabase", visibility=["read"] + ) + """The date and time the Always Free database will be automatically deleted because of inactivity.""" + time_local_data_guard_enabled: Optional[str] = rest_field(name="timeLocalDataGuardEnabled", visibility=["read"]) + """The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the + standby was provisioned in the same region as the primary database.""" + time_of_last_failover: Optional[str] = rest_field(name="timeOfLastFailover", visibility=["read"]) + """The timestamp of the last failover operation.""" + time_of_last_refresh: Optional[str] = rest_field(name="timeOfLastRefresh", visibility=["read"]) + """The date and time when last refresh happened.""" + time_of_last_refresh_point: Optional[str] = rest_field(name="timeOfLastRefreshPoint", visibility=["read"]) + """The refresh point timestamp (UTC).""" + time_of_last_switchover: Optional[str] = rest_field(name="timeOfLastSwitchover", visibility=["read"]) + """The timestamp of the last switchover operation for the Autonomous Database.""" + time_reclamation_of_free_autonomous_database: Optional[str] = rest_field( + name="timeReclamationOfFreeAutonomousDatabase", visibility=["read"] + ) + """The date and time the Always Free database will be stopped because of inactivity.""" + used_data_storage_size_in_gbs: Optional[int] = rest_field(name="usedDataStorageSizeInGbs", visibility=["read"]) + """The storage space consumed by Autonomous Database in GBs.""" + used_data_storage_size_in_tbs: Optional[int] = rest_field(name="usedDataStorageSizeInTbs", visibility=["read"]) + """The amount of storage that has been used, in terabytes.""" + ocid: Optional[str] = rest_field(visibility=["read"]) + """Database ocid.""" + backup_retention_period_in_days: Optional[int] = rest_field( + name="backupRetentionPeriodInDays", visibility=["read", "create", "update"] + ) + """Retention period, in days, for long-term backups.""" + whitelisted_ips: Optional[List[str]] = rest_field(name="whitelistedIps", visibility=["read", "create", "update"]) + """The client IP access control list (ACL). This is an array of CIDR notations and/or IP + addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25'].""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + data_base_type: str, + admin_password: Optional[str] = None, + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, + character_set: Optional[str] = None, + compute_count: Optional[float] = None, + compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, + cpu_core_count: Optional[int] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + data_storage_size_in_tbs: Optional[int] = None, + data_storage_size_in_gbs: Optional[int] = None, + db_version: Optional[str] = None, + db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, + display_name: Optional[str] = None, + is_auto_scaling_enabled: Optional[bool] = None, + is_auto_scaling_for_storage_enabled: Optional[bool] = None, + peer_db_id: Optional[str] = None, + is_local_data_guard_enabled: Optional[bool] = None, + is_mtls_connection_required: Optional[bool] = None, + is_preview_version_with_service_terms_accepted: Optional[bool] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + ncharacter_set: Optional[str] = None, + scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, + private_endpoint_ip: Optional[str] = None, + private_endpoint_label: Optional[str] = None, + subnet_id: Optional[str] = None, + vnet_id: Optional[str] = None, + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, + autonomous_database_id: Optional[str] = None, + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, + local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, + open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, + role: Optional[Union[str, "_models.RoleType"]] = None, + backup_retention_period_in_days: Optional[int] = None, + whitelisted_ips: Optional[List[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseCharacterSet(ProxyResource): + """AutonomousDatabaseCharacterSets resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSetProperties + """ + + properties: Optional["_models.AutonomousDatabaseCharacterSetProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.AutonomousDatabaseCharacterSetProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseCharacterSetProperties(_Model): + """AutonomousDatabaseCharacterSet resource model. + + :ivar character_set: The Oracle Autonomous Database supported character sets. Required. + :vartype character_set: str + """ + + character_set: str = rest_field(name="characterSet", visibility=["read", "create", "update", "delete", "query"]) + """The Oracle Autonomous Database supported character sets. Required.""" + + @overload + def __init__( + self, + *, + character_set: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseCloneProperties(AutonomousDatabaseBaseProperties, discriminator="Clone"): + """Autonomous Database clone resource model. + + :ivar admin_password: Admin password. + :vartype admin_password: str + :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :vartype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :ivar character_set: The character set for the autonomous database. + :vartype character_set: str + :ivar compute_count: The compute amount (CPUs) available to the database. + :vartype compute_count: float + :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and + "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :ivar cpu_core_count: The number of CPU cores to be made available to the database. + :vartype cpu_core_count: int + :ivar customer_contacts: Customer Contacts. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :vartype data_storage_size_in_tbs: int + :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created + and attached to the database. + :vartype data_storage_size_in_gbs: int + :ivar db_version: A valid Oracle Database version for Autonomous Database. + :vartype db_version: str + :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :ivar display_name: The user-friendly name for the Autonomous Database. + :vartype display_name: str + :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database + CPU core count. + :vartype is_auto_scaling_enabled: bool + :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :vartype is_auto_scaling_for_storage_enabled: bool + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. + :vartype peer_db_ids: list[str] + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :vartype peer_db_id: str + :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :vartype is_local_data_guard_enabled: bool + :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region + Data Guard enabled. + :vartype is_remote_data_guard_enabled: bool + :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the + Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business + critical DR with a faster recovery time objective (RTO) during failover or + switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Known values are: "Adg" and "BackupBased". + :vartype local_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. + :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary + :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data + Guard failover. + :vartype failed_data_recovery_in_seconds: int + :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :vartype is_mtls_connection_required: bool + :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database + preview version is being provisioned. + :vartype is_preview_version_with_service_terms_accepted: bool + :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. + The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar ncharacter_set: The character set for the Autonomous Database. + :vartype ncharacter_set: str + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", + "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", + "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState + :ivar scheduled_operations: The list of scheduled operations. + :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType + :ivar private_endpoint_ip: The private endpoint Ip address for the resource. + :vartype private_endpoint_ip: str + :ivar private_endpoint_label: The resource's private endpoint label. + :vartype private_endpoint_label: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar subnet_id: Client subnet. + :vartype subnet_id: str + :ivar vnet_id: VNET for network connectivity. + :vartype vnet_id: str + :ivar time_created: The date and time that the database was created. + :vartype time_created: ~datetime.datetime + :ivar time_maintenance_begin: The date and time when maintenance will begin. + :vartype time_maintenance_begin: ~datetime.datetime + :ivar time_maintenance_end: The date and time when maintenance will end. + :vartype time_maintenance_end: ~datetime.datetime + :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and + system data, in terabytes (TB). + :vartype actual_used_data_storage_size_in_tbs: float + :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database + tables and billed for, rounded up. + :vartype allocated_storage_size_in_tbs: float + :ivar apex_details: Information about Oracle APEX Application Development. + :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType + :ivar available_upgrade_versions: List of Oracle Database versions available for a database + upgrade. If there are no version upgrades available, this list is empty. + :vartype available_upgrade_versions: list[str] + :ivar connection_strings: The connection string used to connect to the Autonomous Database. + :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType + :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL + Developer Web with a browser from a Compute instance within your VCN or that has a direct + connection to your VCN. + :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType + :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. + Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". + :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType + :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. + Known values are: "StandardEdition" and "EnterpriseEdition". + :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :ivar autonomous_database_id: Autonomous Database ID. + :vartype autonomous_database_id: str + :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. + :vartype in_memory_area_in_gbs: int + :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would + be created. + :vartype next_long_term_backup_time_stamp: ~datetime.datetime + :ivar long_term_backup_schedule: Details for the long-term backup schedule. + :vartype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :ivar is_preview: Indicates if the Autonomous Database version is a preview version. + :vartype is_preview: bool + :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :vartype local_adg_auto_failover_max_data_loss_limit: int + :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or + OCPU. + :vartype memory_per_oracle_compute_unit_in_gbs: int + :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. + Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and + "FailedDisabling". + :vartype operations_insights_status: str or + ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType + :ivar permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :ivar private_endpoint: The private endpoint for the resource. + :vartype private_endpoint: str + :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. + :vartype provisionable_cpus: list[int] + :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if + Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :ivar service_console_url: The URL of the Service Console for the Autonomous Database. + :vartype service_console_url: str + :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. + :vartype sql_web_developer_url: str + :ivar supported_regions_to_clone_to: The list of regions that support the creation of an + Autonomous Database clone or an Autonomous Data Guard standby database. + :vartype supported_regions_to_clone_to: list[str] + :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the Autonomous Database. + :vartype time_data_guard_role_changed: str + :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database + will be automatically deleted because of inactivity. + :vartype time_deletion_of_free_autonomous_database: str + :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled + for an Autonomous Database where the standby was provisioned in the same region as the primary + database. + :vartype time_local_data_guard_enabled: str + :ivar time_of_last_failover: The timestamp of the last failover operation. + :vartype time_of_last_failover: str + :ivar time_of_last_refresh: The date and time when last refresh happened. + :vartype time_of_last_refresh: str + :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). + :vartype time_of_last_refresh_point: str + :ivar time_of_last_switchover: The timestamp of the last switchover operation for the + Autonomous Database. + :vartype time_of_last_switchover: str + :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database + will be stopped because of inactivity. + :vartype time_reclamation_of_free_autonomous_database: str + :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. + :vartype used_data_storage_size_in_gbs: int + :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. + :vartype used_data_storage_size_in_tbs: int + :ivar ocid: Database ocid. + :vartype ocid: str + :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. + :vartype backup_retention_period_in_days: int + :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :vartype whitelisted_ips: list[str] + :ivar data_base_type: Database type to be created. Required. Clone DB + :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.CLONE + :ivar source: The source of the database. Known values are: "None", "Database", "BackupFromId", + "BackupFromTimestamp", "CloneToRefreshable", "CrossRegionDataguard", and + "CrossRegionDisasterRecovery". + :vartype source: str or ~azure.mgmt.oracledatabase.models.SourceType + :ivar source_id: The Azure resource ID of the Autonomous Database that was cloned to create the + current Autonomous Database. Required. + :vartype source_id: str + :ivar clone_type: The Autonomous Database clone type. Required. Known values are: "Full" and + "Metadata". + :vartype clone_type: str or ~azure.mgmt.oracledatabase.models.CloneType + :ivar is_reconnect_clone_enabled: Indicates if the refreshable clone can be reconnected to its + source database. + :vartype is_reconnect_clone_enabled: bool + :ivar is_refreshable_clone: Indicates if the Autonomous Database is a refreshable clone. + :vartype is_refreshable_clone: bool + :ivar refreshable_model: The refresh mode of the clone. Known values are: "Automatic" and + "Manual". + :vartype refreshable_model: str or ~azure.mgmt.oracledatabase.models.RefreshableModelType + :ivar refreshable_status: The refresh status of the clone. Known values are: "Refreshing" and + "NotRefreshing". + :vartype refreshable_status: str or ~azure.mgmt.oracledatabase.models.RefreshableStatusType + :ivar time_until_reconnect_clone_enabled: The time and date as an RFC3339 formatted string, + e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to + its source database. + :vartype time_until_reconnect_clone_enabled: str + """ + + data_base_type: Literal[DataBaseType.CLONE] = rest_discriminator(name="dataBaseType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Database type to be created. Required. Clone DB""" + source: Optional[Union[str, "_models.SourceType"]] = rest_field(visibility=["create"]) + """The source of the database. Known values are: \"None\", \"Database\", \"BackupFromId\", + \"BackupFromTimestamp\", \"CloneToRefreshable\", \"CrossRegionDataguard\", and + \"CrossRegionDisasterRecovery\".""" + source_id: str = rest_field(name="sourceId", visibility=["read", "create"]) + """The Azure resource ID of the Autonomous Database that was cloned to create the current + Autonomous Database. Required.""" + clone_type: Union[str, "_models.CloneType"] = rest_field(name="cloneType", visibility=["create"]) + """The Autonomous Database clone type. Required. Known values are: \"Full\" and \"Metadata\".""" + is_reconnect_clone_enabled: Optional[bool] = rest_field(name="isReconnectCloneEnabled", visibility=["read"]) + """Indicates if the refreshable clone can be reconnected to its source database.""" + is_refreshable_clone: Optional[bool] = rest_field(name="isRefreshableClone", visibility=["read"]) + """Indicates if the Autonomous Database is a refreshable clone.""" + refreshable_model: Optional[Union[str, "_models.RefreshableModelType"]] = rest_field( + name="refreshableModel", visibility=["create"] + ) + """The refresh mode of the clone. Known values are: \"Automatic\" and \"Manual\".""" + refreshable_status: Optional[Union[str, "_models.RefreshableStatusType"]] = rest_field( + name="refreshableStatus", visibility=["read"] + ) + """The refresh status of the clone. Known values are: \"Refreshing\" and \"NotRefreshing\".""" + time_until_reconnect_clone_enabled: Optional[str] = rest_field( + name="timeUntilReconnectCloneEnabled", visibility=["read", "update"] + ) + """The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the + limit for a refreshable clone to be reconnected to its source database.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + source_id: str, + clone_type: Union[str, "_models.CloneType"], + admin_password: Optional[str] = None, + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, + character_set: Optional[str] = None, + compute_count: Optional[float] = None, + compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, + cpu_core_count: Optional[int] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + data_storage_size_in_tbs: Optional[int] = None, + data_storage_size_in_gbs: Optional[int] = None, + db_version: Optional[str] = None, + db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, + display_name: Optional[str] = None, + is_auto_scaling_enabled: Optional[bool] = None, + is_auto_scaling_for_storage_enabled: Optional[bool] = None, + peer_db_id: Optional[str] = None, + is_local_data_guard_enabled: Optional[bool] = None, + is_mtls_connection_required: Optional[bool] = None, + is_preview_version_with_service_terms_accepted: Optional[bool] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + ncharacter_set: Optional[str] = None, + scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, + private_endpoint_ip: Optional[str] = None, + private_endpoint_label: Optional[str] = None, + subnet_id: Optional[str] = None, + vnet_id: Optional[str] = None, + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, + autonomous_database_id: Optional[str] = None, + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, + local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, + open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, + role: Optional[Union[str, "_models.RoleType"]] = None, + backup_retention_period_in_days: Optional[int] = None, + whitelisted_ips: Optional[List[str]] = None, + source: Optional[Union[str, "_models.SourceType"]] = None, + refreshable_model: Optional[Union[str, "_models.RefreshableModelType"]] = None, + time_until_reconnect_clone_enabled: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, data_base_type=DataBaseType.CLONE, **kwargs) + + +class AutonomousDatabaseCrossRegionDisasterRecoveryProperties( + AutonomousDatabaseBaseProperties, discriminator="CrossRegionDisasterRecovery" +): # pylint: disable=name-too-long + """Autonomous Database Cross Region Disaster Recovery resource model. + + :ivar admin_password: Admin password. + :vartype admin_password: str + :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :vartype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :ivar character_set: The character set for the autonomous database. + :vartype character_set: str + :ivar compute_count: The compute amount (CPUs) available to the database. + :vartype compute_count: float + :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and + "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :ivar cpu_core_count: The number of CPU cores to be made available to the database. + :vartype cpu_core_count: int + :ivar customer_contacts: Customer Contacts. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :vartype data_storage_size_in_tbs: int + :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created + and attached to the database. + :vartype data_storage_size_in_gbs: int + :ivar db_version: A valid Oracle Database version for Autonomous Database. + :vartype db_version: str + :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :ivar display_name: The user-friendly name for the Autonomous Database. + :vartype display_name: str + :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database + CPU core count. + :vartype is_auto_scaling_enabled: bool + :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :vartype is_auto_scaling_for_storage_enabled: bool + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. + :vartype peer_db_ids: list[str] + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :vartype peer_db_id: str + :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :vartype is_local_data_guard_enabled: bool + :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region + Data Guard enabled. + :vartype is_remote_data_guard_enabled: bool + :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the + Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business + critical DR with a faster recovery time objective (RTO) during failover or + switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Known values are: "Adg" and "BackupBased". + :vartype local_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. + :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary + :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data + Guard failover. + :vartype failed_data_recovery_in_seconds: int + :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :vartype is_mtls_connection_required: bool + :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database + preview version is being provisioned. + :vartype is_preview_version_with_service_terms_accepted: bool + :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. + The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar ncharacter_set: The character set for the Autonomous Database. + :vartype ncharacter_set: str + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", + "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", + "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState + :ivar scheduled_operations: The list of scheduled operations. + :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType + :ivar private_endpoint_ip: The private endpoint Ip address for the resource. + :vartype private_endpoint_ip: str + :ivar private_endpoint_label: The resource's private endpoint label. + :vartype private_endpoint_label: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar subnet_id: Client subnet. + :vartype subnet_id: str + :ivar vnet_id: VNET for network connectivity. + :vartype vnet_id: str + :ivar time_created: The date and time that the database was created. + :vartype time_created: ~datetime.datetime + :ivar time_maintenance_begin: The date and time when maintenance will begin. + :vartype time_maintenance_begin: ~datetime.datetime + :ivar time_maintenance_end: The date and time when maintenance will end. + :vartype time_maintenance_end: ~datetime.datetime + :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and + system data, in terabytes (TB). + :vartype actual_used_data_storage_size_in_tbs: float + :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database + tables and billed for, rounded up. + :vartype allocated_storage_size_in_tbs: float + :ivar apex_details: Information about Oracle APEX Application Development. + :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType + :ivar available_upgrade_versions: List of Oracle Database versions available for a database + upgrade. If there are no version upgrades available, this list is empty. + :vartype available_upgrade_versions: list[str] + :ivar connection_strings: The connection string used to connect to the Autonomous Database. + :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType + :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL + Developer Web with a browser from a Compute instance within your VCN or that has a direct + connection to your VCN. + :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType + :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. + Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". + :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType + :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. + Known values are: "StandardEdition" and "EnterpriseEdition". + :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :ivar autonomous_database_id: Autonomous Database ID. + :vartype autonomous_database_id: str + :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. + :vartype in_memory_area_in_gbs: int + :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would + be created. + :vartype next_long_term_backup_time_stamp: ~datetime.datetime + :ivar long_term_backup_schedule: Details for the long-term backup schedule. + :vartype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :ivar is_preview: Indicates if the Autonomous Database version is a preview version. + :vartype is_preview: bool + :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :vartype local_adg_auto_failover_max_data_loss_limit: int + :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or + OCPU. + :vartype memory_per_oracle_compute_unit_in_gbs: int + :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. + Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and + "FailedDisabling". + :vartype operations_insights_status: str or + ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType + :ivar permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :ivar private_endpoint: The private endpoint for the resource. + :vartype private_endpoint: str + :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. + :vartype provisionable_cpus: list[int] + :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if + Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :ivar service_console_url: The URL of the Service Console for the Autonomous Database. + :vartype service_console_url: str + :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. + :vartype sql_web_developer_url: str + :ivar supported_regions_to_clone_to: The list of regions that support the creation of an + Autonomous Database clone or an Autonomous Data Guard standby database. + :vartype supported_regions_to_clone_to: list[str] + :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the Autonomous Database. + :vartype time_data_guard_role_changed: str + :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database + will be automatically deleted because of inactivity. + :vartype time_deletion_of_free_autonomous_database: str + :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled + for an Autonomous Database where the standby was provisioned in the same region as the primary + database. + :vartype time_local_data_guard_enabled: str + :ivar time_of_last_failover: The timestamp of the last failover operation. + :vartype time_of_last_failover: str + :ivar time_of_last_refresh: The date and time when last refresh happened. + :vartype time_of_last_refresh: str + :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). + :vartype time_of_last_refresh_point: str + :ivar time_of_last_switchover: The timestamp of the last switchover operation for the + Autonomous Database. + :vartype time_of_last_switchover: str + :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database + will be stopped because of inactivity. + :vartype time_reclamation_of_free_autonomous_database: str + :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. + :vartype used_data_storage_size_in_gbs: int + :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. + :vartype used_data_storage_size_in_tbs: int + :ivar ocid: Database ocid. + :vartype ocid: str + :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. + :vartype backup_retention_period_in_days: int + :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :vartype whitelisted_ips: list[str] + :ivar data_base_type: Database type to be created. Required. Cross Region Disaster Recovery + :vartype data_base_type: str or + ~azure.mgmt.oracledatabase.models.CROSS_REGION_DISASTER_RECOVERY + :ivar source: The source of the database. Required. cross region disaster recovery source + :vartype source: str or ~azure.mgmt.oracledatabase.models.CROSS_REGION_DISASTER_RECOVERY + :ivar source_id: The Azure ID of the source Autonomous Database that will be used to create a + new peer database for the DR association. Required. + :vartype source_id: str + :ivar source_location: The name of the region where source Autonomous Database exists. + :vartype source_location: str + :ivar source_ocid: The source database ocid. + :vartype source_ocid: str + :ivar remote_disaster_recovery_type: Indicates the cross-region disaster recovery (DR) type of + the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type + provides business critical DR with a faster recovery time objective (RTO) during failover or + switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Required. Known values are: "Adg" and "BackupBased". + :vartype remote_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar is_replicate_automatic_backups: If true, 7 days worth of backups are replicated across + regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the + backups taken on the Primary are not replicated to the Standby database. + :vartype is_replicate_automatic_backups: bool + """ + + data_base_type: Literal[DataBaseType.CROSS_REGION_DISASTER_RECOVERY] = rest_discriminator(name="dataBaseType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Database type to be created. Required. Cross Region Disaster Recovery""" + source: Literal[SourceType.CROSS_REGION_DISASTER_RECOVERY] = rest_field(visibility=["create"]) + """The source of the database. Required. cross region disaster recovery source""" + source_id: str = rest_field(name="sourceId", visibility=["read", "create"]) + """The Azure ID of the source Autonomous Database that will be used to create a new peer database + for the DR association. Required.""" + source_location: Optional[str] = rest_field(name="sourceLocation", visibility=["create"]) + """The name of the region where source Autonomous Database exists.""" + source_ocid: Optional[str] = rest_field(name="sourceOcid", visibility=["create"]) + """The source database ocid.""" + remote_disaster_recovery_type: Union[str, "_models.DisasterRecoveryType"] = rest_field( + name="remoteDisasterRecoveryType", visibility=["read", "create"] + ) + """Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database + Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a + faster recovery time objective (RTO) during failover or switchover. Backup-based DR type + provides lower cost DR with a slower RTO during failover or switchover. Required. Known values + are: \"Adg\" and \"BackupBased\".""" + is_replicate_automatic_backups: Optional[bool] = rest_field( + name="isReplicateAutomaticBackups", visibility=["read", "create"] + ) + """If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or + Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not + replicated to the Standby database.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + source: Literal[SourceType.CROSS_REGION_DISASTER_RECOVERY], + source_id: str, + remote_disaster_recovery_type: Union[str, "_models.DisasterRecoveryType"], + admin_password: Optional[str] = None, + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, + character_set: Optional[str] = None, + compute_count: Optional[float] = None, + compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, + cpu_core_count: Optional[int] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + data_storage_size_in_tbs: Optional[int] = None, + data_storage_size_in_gbs: Optional[int] = None, + db_version: Optional[str] = None, + db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, + display_name: Optional[str] = None, + is_auto_scaling_enabled: Optional[bool] = None, + is_auto_scaling_for_storage_enabled: Optional[bool] = None, + peer_db_id: Optional[str] = None, + is_local_data_guard_enabled: Optional[bool] = None, + is_mtls_connection_required: Optional[bool] = None, + is_preview_version_with_service_terms_accepted: Optional[bool] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + ncharacter_set: Optional[str] = None, + scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, + private_endpoint_ip: Optional[str] = None, + private_endpoint_label: Optional[str] = None, + subnet_id: Optional[str] = None, + vnet_id: Optional[str] = None, + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, + autonomous_database_id: Optional[str] = None, + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, + local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, + open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, + role: Optional[Union[str, "_models.RoleType"]] = None, + backup_retention_period_in_days: Optional[int] = None, + whitelisted_ips: Optional[List[str]] = None, + source_location: Optional[str] = None, + source_ocid: Optional[str] = None, + is_replicate_automatic_backups: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, data_base_type=DataBaseType.CROSS_REGION_DISASTER_RECOVERY, **kwargs) + + +class AutonomousDatabaseFromBackupTimestampProperties( + AutonomousDatabaseBaseProperties, discriminator="CloneFromBackupTimestamp" +): # pylint: disable=name-too-long + """Autonomous Database From Backup Timestamp resource model. + + :ivar admin_password: Admin password. + :vartype admin_password: str + :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :vartype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :ivar character_set: The character set for the autonomous database. + :vartype character_set: str + :ivar compute_count: The compute amount (CPUs) available to the database. + :vartype compute_count: float + :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and + "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :ivar cpu_core_count: The number of CPU cores to be made available to the database. + :vartype cpu_core_count: int + :ivar customer_contacts: Customer Contacts. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :vartype data_storage_size_in_tbs: int + :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created + and attached to the database. + :vartype data_storage_size_in_gbs: int + :ivar db_version: A valid Oracle Database version for Autonomous Database. + :vartype db_version: str + :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :ivar display_name: The user-friendly name for the Autonomous Database. + :vartype display_name: str + :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database + CPU core count. + :vartype is_auto_scaling_enabled: bool + :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :vartype is_auto_scaling_for_storage_enabled: bool + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. + :vartype peer_db_ids: list[str] + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :vartype peer_db_id: str + :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :vartype is_local_data_guard_enabled: bool + :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region + Data Guard enabled. + :vartype is_remote_data_guard_enabled: bool + :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the + Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business + critical DR with a faster recovery time objective (RTO) during failover or + switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Known values are: "Adg" and "BackupBased". + :vartype local_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. + :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary + :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data + Guard failover. + :vartype failed_data_recovery_in_seconds: int + :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :vartype is_mtls_connection_required: bool + :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database + preview version is being provisioned. + :vartype is_preview_version_with_service_terms_accepted: bool + :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. + The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar ncharacter_set: The character set for the Autonomous Database. + :vartype ncharacter_set: str + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", + "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", + "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState + :ivar scheduled_operations: The list of scheduled operations. + :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType + :ivar private_endpoint_ip: The private endpoint Ip address for the resource. + :vartype private_endpoint_ip: str + :ivar private_endpoint_label: The resource's private endpoint label. + :vartype private_endpoint_label: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar subnet_id: Client subnet. + :vartype subnet_id: str + :ivar vnet_id: VNET for network connectivity. + :vartype vnet_id: str + :ivar time_created: The date and time that the database was created. + :vartype time_created: ~datetime.datetime + :ivar time_maintenance_begin: The date and time when maintenance will begin. + :vartype time_maintenance_begin: ~datetime.datetime + :ivar time_maintenance_end: The date and time when maintenance will end. + :vartype time_maintenance_end: ~datetime.datetime + :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and + system data, in terabytes (TB). + :vartype actual_used_data_storage_size_in_tbs: float + :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database + tables and billed for, rounded up. + :vartype allocated_storage_size_in_tbs: float + :ivar apex_details: Information about Oracle APEX Application Development. + :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType + :ivar available_upgrade_versions: List of Oracle Database versions available for a database + upgrade. If there are no version upgrades available, this list is empty. + :vartype available_upgrade_versions: list[str] + :ivar connection_strings: The connection string used to connect to the Autonomous Database. + :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType + :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL + Developer Web with a browser from a Compute instance within your VCN or that has a direct + connection to your VCN. + :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType + :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. + Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". + :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType + :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. + Known values are: "StandardEdition" and "EnterpriseEdition". + :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :ivar autonomous_database_id: Autonomous Database ID. + :vartype autonomous_database_id: str + :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. + :vartype in_memory_area_in_gbs: int + :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would + be created. + :vartype next_long_term_backup_time_stamp: ~datetime.datetime + :ivar long_term_backup_schedule: Details for the long-term backup schedule. + :vartype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :ivar is_preview: Indicates if the Autonomous Database version is a preview version. + :vartype is_preview: bool + :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :vartype local_adg_auto_failover_max_data_loss_limit: int + :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or + OCPU. + :vartype memory_per_oracle_compute_unit_in_gbs: int + :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. + Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and + "FailedDisabling". + :vartype operations_insights_status: str or + ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType + :ivar permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :ivar private_endpoint: The private endpoint for the resource. + :vartype private_endpoint: str + :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. + :vartype provisionable_cpus: list[int] + :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if + Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :ivar service_console_url: The URL of the Service Console for the Autonomous Database. + :vartype service_console_url: str + :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. + :vartype sql_web_developer_url: str + :ivar supported_regions_to_clone_to: The list of regions that support the creation of an + Autonomous Database clone or an Autonomous Data Guard standby database. + :vartype supported_regions_to_clone_to: list[str] + :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the Autonomous Database. + :vartype time_data_guard_role_changed: str + :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database + will be automatically deleted because of inactivity. + :vartype time_deletion_of_free_autonomous_database: str + :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled + for an Autonomous Database where the standby was provisioned in the same region as the primary + database. + :vartype time_local_data_guard_enabled: str + :ivar time_of_last_failover: The timestamp of the last failover operation. + :vartype time_of_last_failover: str + :ivar time_of_last_refresh: The date and time when last refresh happened. + :vartype time_of_last_refresh: str + :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). + :vartype time_of_last_refresh_point: str + :ivar time_of_last_switchover: The timestamp of the last switchover operation for the + Autonomous Database. + :vartype time_of_last_switchover: str + :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database + will be stopped because of inactivity. + :vartype time_reclamation_of_free_autonomous_database: str + :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. + :vartype used_data_storage_size_in_gbs: int + :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. + :vartype used_data_storage_size_in_tbs: int + :ivar ocid: Database ocid. + :vartype ocid: str + :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. + :vartype backup_retention_period_in_days: int + :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :vartype whitelisted_ips: list[str] + :ivar data_base_type: Database type to be created. Required. Clone DB from backup timestamp + :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.CLONE_FROM_BACKUP_TIMESTAMP + :ivar source: The source of the database. Required. Backup from timestamp source + :vartype source: str or ~azure.mgmt.oracledatabase.models.BACKUP_FROM_TIMESTAMP + :ivar source_id: The ID of the source Autonomous Database that you will clone to create a new + Autonomous Database. Required. + :vartype source_id: str + :ivar clone_type: The Autonomous Database clone type. Required. Known values are: "Full" and + "Metadata". + :vartype clone_type: str or ~azure.mgmt.oracledatabase.models.CloneType + :ivar timestamp: The timestamp specified for the point-in-time clone of the source Autonomous + Database. The timestamp must be in the past. + :vartype timestamp: ~datetime.datetime + :ivar use_latest_available_backup_time_stamp: Clone from latest available backup timestamp. + :vartype use_latest_available_backup_time_stamp: bool + """ + + data_base_type: Literal[DataBaseType.CLONE_FROM_BACKUP_TIMESTAMP] = rest_discriminator(name="dataBaseType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Database type to be created. Required. Clone DB from backup timestamp""" + source: Literal[SourceType.BACKUP_FROM_TIMESTAMP] = rest_field(visibility=["create"]) + """The source of the database. Required. Backup from timestamp source""" + source_id: str = rest_field(name="sourceId", visibility=["read", "create"]) + """The ID of the source Autonomous Database that you will clone to create a new Autonomous + Database. Required.""" + clone_type: Union[str, "_models.CloneType"] = rest_field(name="cloneType", visibility=["create"]) + """The Autonomous Database clone type. Required. Known values are: \"Full\" and \"Metadata\".""" + timestamp: Optional[datetime.datetime] = rest_field(visibility=["create"], format="rfc3339") + """The timestamp specified for the point-in-time clone of the source Autonomous Database. The + timestamp must be in the past.""" + use_latest_available_backup_time_stamp: Optional[bool] = rest_field( + name="useLatestAvailableBackupTimeStamp", visibility=["create"] + ) + """Clone from latest available backup timestamp.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + source: Literal[SourceType.BACKUP_FROM_TIMESTAMP], + source_id: str, + clone_type: Union[str, "_models.CloneType"], + admin_password: Optional[str] = None, + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, + character_set: Optional[str] = None, + compute_count: Optional[float] = None, + compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, + cpu_core_count: Optional[int] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + data_storage_size_in_tbs: Optional[int] = None, + data_storage_size_in_gbs: Optional[int] = None, + db_version: Optional[str] = None, + db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, + display_name: Optional[str] = None, + is_auto_scaling_enabled: Optional[bool] = None, + is_auto_scaling_for_storage_enabled: Optional[bool] = None, + peer_db_id: Optional[str] = None, + is_local_data_guard_enabled: Optional[bool] = None, + is_mtls_connection_required: Optional[bool] = None, + is_preview_version_with_service_terms_accepted: Optional[bool] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + ncharacter_set: Optional[str] = None, + scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, + private_endpoint_ip: Optional[str] = None, + private_endpoint_label: Optional[str] = None, + subnet_id: Optional[str] = None, + vnet_id: Optional[str] = None, + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, + autonomous_database_id: Optional[str] = None, + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, + local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, + open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, + role: Optional[Union[str, "_models.RoleType"]] = None, + backup_retention_period_in_days: Optional[int] = None, + whitelisted_ips: Optional[List[str]] = None, + timestamp: Optional[datetime.datetime] = None, + use_latest_available_backup_time_stamp: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, data_base_type=DataBaseType.CLONE_FROM_BACKUP_TIMESTAMP, **kwargs) + + +class AutonomousDatabaseNationalCharacterSet(ProxyResource): + """AutonomousDatabaseNationalCharacterSets resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSetProperties + """ + + properties: Optional["_models.AutonomousDatabaseNationalCharacterSetProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.AutonomousDatabaseNationalCharacterSetProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseNationalCharacterSetProperties(_Model): # pylint: disable=name-too-long + """AutonomousDatabaseNationalCharacterSet resource model. + + :ivar character_set: The Oracle Autonomous Database supported national character sets. + Required. + :vartype character_set: str + """ + + character_set: str = rest_field(name="characterSet", visibility=["read", "create", "update", "delete", "query"]) + """The Oracle Autonomous Database supported national character sets. Required.""" + + @overload + def __init__( + self, + *, + character_set: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties, discriminator="Regular"): + """Autonomous Database resource model. + + :ivar admin_password: Admin password. + :vartype admin_password: str + :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :vartype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :ivar character_set: The character set for the autonomous database. + :vartype character_set: str + :ivar compute_count: The compute amount (CPUs) available to the database. + :vartype compute_count: float + :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and + "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :ivar cpu_core_count: The number of CPU cores to be made available to the database. + :vartype cpu_core_count: int + :ivar customer_contacts: Customer Contacts. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :vartype data_storage_size_in_tbs: int + :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created + and attached to the database. + :vartype data_storage_size_in_gbs: int + :ivar db_version: A valid Oracle Database version for Autonomous Database. + :vartype db_version: str + :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :ivar display_name: The user-friendly name for the Autonomous Database. + :vartype display_name: str + :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database + CPU core count. + :vartype is_auto_scaling_enabled: bool + :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :vartype is_auto_scaling_for_storage_enabled: bool + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. + :vartype peer_db_ids: list[str] + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :vartype peer_db_id: str + :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :vartype is_local_data_guard_enabled: bool + :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region + Data Guard enabled. + :vartype is_remote_data_guard_enabled: bool + :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the + Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business + critical DR with a faster recovery time objective (RTO) during failover or + switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Known values are: "Adg" and "BackupBased". + :vartype local_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. + :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary + :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data + Guard failover. + :vartype failed_data_recovery_in_seconds: int + :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :vartype is_mtls_connection_required: bool + :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database + preview version is being provisioned. + :vartype is_preview_version_with_service_terms_accepted: bool + :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. + The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar ncharacter_set: The character set for the Autonomous Database. + :vartype ncharacter_set: str + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", + "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", + "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState + :ivar scheduled_operations: The list of scheduled operations. + :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType + :ivar private_endpoint_ip: The private endpoint Ip address for the resource. + :vartype private_endpoint_ip: str + :ivar private_endpoint_label: The resource's private endpoint label. + :vartype private_endpoint_label: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar subnet_id: Client subnet. + :vartype subnet_id: str + :ivar vnet_id: VNET for network connectivity. + :vartype vnet_id: str + :ivar time_created: The date and time that the database was created. + :vartype time_created: ~datetime.datetime + :ivar time_maintenance_begin: The date and time when maintenance will begin. + :vartype time_maintenance_begin: ~datetime.datetime + :ivar time_maintenance_end: The date and time when maintenance will end. + :vartype time_maintenance_end: ~datetime.datetime + :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and + system data, in terabytes (TB). + :vartype actual_used_data_storage_size_in_tbs: float + :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database + tables and billed for, rounded up. + :vartype allocated_storage_size_in_tbs: float + :ivar apex_details: Information about Oracle APEX Application Development. + :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType + :ivar available_upgrade_versions: List of Oracle Database versions available for a database + upgrade. If there are no version upgrades available, this list is empty. + :vartype available_upgrade_versions: list[str] + :ivar connection_strings: The connection string used to connect to the Autonomous Database. + :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType + :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL + Developer Web with a browser from a Compute instance within your VCN or that has a direct + connection to your VCN. + :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType + :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. + Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". + :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType + :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. + Known values are: "StandardEdition" and "EnterpriseEdition". + :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :ivar autonomous_database_id: Autonomous Database ID. + :vartype autonomous_database_id: str + :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. + :vartype in_memory_area_in_gbs: int + :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would + be created. + :vartype next_long_term_backup_time_stamp: ~datetime.datetime + :ivar long_term_backup_schedule: Details for the long-term backup schedule. + :vartype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :ivar is_preview: Indicates if the Autonomous Database version is a preview version. + :vartype is_preview: bool + :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :vartype local_adg_auto_failover_max_data_loss_limit: int + :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or + OCPU. + :vartype memory_per_oracle_compute_unit_in_gbs: int + :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. + Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and + "FailedDisabling". + :vartype operations_insights_status: str or + ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType + :ivar permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :ivar private_endpoint: The private endpoint for the resource. + :vartype private_endpoint: str + :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. + :vartype provisionable_cpus: list[int] + :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if + Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :ivar service_console_url: The URL of the Service Console for the Autonomous Database. + :vartype service_console_url: str + :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. + :vartype sql_web_developer_url: str + :ivar supported_regions_to_clone_to: The list of regions that support the creation of an + Autonomous Database clone or an Autonomous Data Guard standby database. + :vartype supported_regions_to_clone_to: list[str] + :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the Autonomous Database. + :vartype time_data_guard_role_changed: str + :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database + will be automatically deleted because of inactivity. + :vartype time_deletion_of_free_autonomous_database: str + :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled + for an Autonomous Database where the standby was provisioned in the same region as the primary + database. + :vartype time_local_data_guard_enabled: str + :ivar time_of_last_failover: The timestamp of the last failover operation. + :vartype time_of_last_failover: str + :ivar time_of_last_refresh: The date and time when last refresh happened. + :vartype time_of_last_refresh: str + :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). + :vartype time_of_last_refresh_point: str + :ivar time_of_last_switchover: The timestamp of the last switchover operation for the + Autonomous Database. + :vartype time_of_last_switchover: str + :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database + will be stopped because of inactivity. + :vartype time_reclamation_of_free_autonomous_database: str + :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. + :vartype used_data_storage_size_in_gbs: int + :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. + :vartype used_data_storage_size_in_tbs: int + :ivar ocid: Database ocid. + :vartype ocid: str + :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. + :vartype backup_retention_period_in_days: int + :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :vartype whitelisted_ips: list[str] + :ivar data_base_type: Database type to be created. Required. Regular DB + :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.REGULAR + """ + + data_base_type: Literal[DataBaseType.REGULAR] = rest_discriminator(name="dataBaseType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Database type to be created. Required. Regular DB""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + admin_password: Optional[str] = None, + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, + character_set: Optional[str] = None, + compute_count: Optional[float] = None, + compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, + cpu_core_count: Optional[int] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + data_storage_size_in_tbs: Optional[int] = None, + data_storage_size_in_gbs: Optional[int] = None, + db_version: Optional[str] = None, + db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, + display_name: Optional[str] = None, + is_auto_scaling_enabled: Optional[bool] = None, + is_auto_scaling_for_storage_enabled: Optional[bool] = None, + peer_db_id: Optional[str] = None, + is_local_data_guard_enabled: Optional[bool] = None, + is_mtls_connection_required: Optional[bool] = None, + is_preview_version_with_service_terms_accepted: Optional[bool] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + ncharacter_set: Optional[str] = None, + scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, + private_endpoint_ip: Optional[str] = None, + private_endpoint_label: Optional[str] = None, + subnet_id: Optional[str] = None, + vnet_id: Optional[str] = None, + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, + autonomous_database_id: Optional[str] = None, + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, + local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, + open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, + role: Optional[Union[str, "_models.RoleType"]] = None, + backup_retention_period_in_days: Optional[int] = None, + whitelisted_ips: Optional[List[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, data_base_type=DataBaseType.REGULAR, **kwargs) + + +class AutonomousDatabaseStandbySummary(_Model): + """Autonomous Disaster Recovery standby database details. + + :ivar lag_time_in_seconds: The amount of time, in seconds, that the data of the standby + database lags the data of the primary database. Can be used to determine the potential data + loss in the event of a failover. + :vartype lag_time_in_seconds: int + :ivar lifecycle_state: The current state of the Autonomous Database. Known values are: + "Provisioning", "Available", "Stopping", "Stopped", "Starting", "Terminating", "Terminated", + "Unavailable", "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the standby Autonomous Database. + :vartype time_data_guard_role_changed: str + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: str + """ + + lag_time_in_seconds: Optional[int] = rest_field( + name="lagTimeInSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """The amount of time, in seconds, that the data of the standby database lags the data of the + primary database. Can be used to determine the potential data loss in the event of a failover.""" + lifecycle_state: Optional[Union[str, "_models.AutonomousDatabaseLifecycleState"]] = rest_field( + name="lifecycleState", visibility=["read", "create", "update", "delete", "query"] + ) + """The current state of the Autonomous Database. Known values are: \"Provisioning\", + \"Available\", \"Stopping\", \"Stopped\", \"Starting\", \"Terminating\", \"Terminated\", + \"Unavailable\", \"RestoreInProgress\", \"RestoreFailed\", \"BackupInProgress\", + \"ScaleInProgress\", \"AvailableNeedsAttention\", \"Updating\", \"MaintenanceInProgress\", + \"Restarting\", \"Recreating\", \"RoleChangeInProgress\", \"Upgrading\", \"Inaccessible\", and + \"Standby\".""" + lifecycle_details: Optional[str] = rest_field( + name="lifecycleDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional information about the current lifecycle state.""" + time_data_guard_role_changed: Optional[str] = rest_field( + name="timeDataGuardRoleChanged", visibility=["read", "create", "update", "delete", "query"] + ) + """The date and time the Autonomous Data Guard role was switched for the standby Autonomous + Database.""" + time_disaster_recovery_role_changed: Optional[str] = rest_field( + name="timeDisasterRecoveryRoleChanged", visibility=["read", "create", "update", "delete", "query"] + ) + """The date and time the Disaster Recovery role was switched for the standby Autonomous Database.""" + + @overload + def __init__( + self, + *, + lag_time_in_seconds: Optional[int] = None, + lifecycle_state: Optional[Union[str, "_models.AutonomousDatabaseLifecycleState"]] = None, + lifecycle_details: Optional[str] = None, + time_data_guard_role_changed: Optional[str] = None, + time_disaster_recovery_role_changed: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseUpdate(_Model): + """The type used for update operations of the AutonomousDatabase. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdateProperties + """ + + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.AutonomousDatabaseUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.AutonomousDatabaseUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseUpdateProperties(_Model): + """The updatable properties of the AutonomousDatabase. + + :ivar admin_password: Admin password. + :vartype admin_password: str + :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :vartype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :ivar compute_count: The compute amount (CPUs) available to the database. + :vartype compute_count: float + :ivar cpu_core_count: The number of CPU cores to be made available to the database. + :vartype cpu_core_count: int + :ivar customer_contacts: Customer Contacts. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :vartype data_storage_size_in_tbs: int + :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created + and attached to the database. + :vartype data_storage_size_in_gbs: int + :ivar display_name: The user-friendly name for the Autonomous Database. + :vartype display_name: str + :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database + CPU core count. + :vartype is_auto_scaling_enabled: bool + :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :vartype is_auto_scaling_for_storage_enabled: bool + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :vartype peer_db_id: str + :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :vartype is_local_data_guard_enabled: bool + :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :vartype is_mtls_connection_required: bool + :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. + The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar scheduled_operations: The list of scheduled operations. + :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsTypeUpdate + :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. + Known values are: "StandardEdition" and "EnterpriseEdition". + :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :ivar long_term_backup_schedule: Details for the long-term backup schedule. + :vartype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :vartype local_adg_auto_failover_max_data_loss_limit: int + :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :ivar permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if + Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. + :vartype backup_retention_period_in_days: int + :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :vartype whitelisted_ips: list[str] + """ + + admin_password: Optional[str] = rest_field(name="adminPassword", visibility=["create", "update"]) + """Admin password.""" + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = ( + rest_field(name="autonomousMaintenanceScheduleType", visibility=["read", "create", "update"]) + ) + """The maintenance schedule type of the Autonomous Database Serverless. Known values are: + \"Early\" and \"Regular\".""" + compute_count: Optional[float] = rest_field(name="computeCount", visibility=["read", "create", "update"]) + """The compute amount (CPUs) available to the database.""" + cpu_core_count: Optional[int] = rest_field(name="cpuCoreCount", visibility=["read", "create", "update"]) + """The number of CPU cores to be made available to the database.""" + customer_contacts: Optional[List["_models.CustomerContact"]] = rest_field( + name="customerContacts", visibility=["read", "create", "update"] + ) + """Customer Contacts.""" + data_storage_size_in_tbs: Optional[int] = rest_field( + name="dataStorageSizeInTbs", visibility=["read", "create", "update"] + ) + """The quantity of data in the database, in terabytes.""" + data_storage_size_in_gbs: Optional[int] = rest_field( + name="dataStorageSizeInGbs", visibility=["read", "create", "update"] + ) + """The size, in gigabytes, of the data volume that will be created and attached to the database.""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read", "create", "update"]) + """The user-friendly name for the Autonomous Database.""" + is_auto_scaling_enabled: Optional[bool] = rest_field( + name="isAutoScalingEnabled", visibility=["read", "create", "update"] + ) + """Indicates if auto scaling is enabled for the Autonomous Database CPU core count.""" + is_auto_scaling_for_storage_enabled: Optional[bool] = rest_field( + name="isAutoScalingForStorageEnabled", visibility=["read", "create", "update"] + ) + """Indicates if auto scaling is enabled for the Autonomous Database storage.""" + peer_db_id: Optional[str] = rest_field(name="peerDbId", visibility=["update"]) + """The Azure resource ID of the Disaster Recovery peer database, which is located in a different + region from the current peer database.""" + is_local_data_guard_enabled: Optional[bool] = rest_field( + name="isLocalDataGuardEnabled", visibility=["read", "create", "update"] + ) + """Indicates whether the Autonomous Database has local or called in-region Data Guard enabled.""" + is_mtls_connection_required: Optional[bool] = rest_field( + name="isMtlsConnectionRequired", visibility=["read", "create", "update"] + ) + """Specifies if the Autonomous Database requires mTLS connections.""" + license_model: Optional[Union[str, "_models.LicenseModel"]] = rest_field( + name="licenseModel", visibility=["read", "create", "update"] + ) + """The Oracle license model that applies to the Oracle Autonomous Database. The default is + LICENSE_INCLUDED. Known values are: \"LicenseIncluded\" and \"BringYourOwnLicense\".""" + scheduled_operations: Optional["_models.ScheduledOperationsTypeUpdate"] = rest_field( + name="scheduledOperations", visibility=["read", "create", "update"] + ) + """The list of scheduled operations.""" + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = rest_field( + name="databaseEdition", visibility=["read", "create", "update"] + ) + """The Oracle Database Edition that applies to the Autonomous databases. Known values are: + \"StandardEdition\" and \"EnterpriseEdition\".""" + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = rest_field( + name="longTermBackupSchedule", visibility=["read", "update"] + ) + """Details for the long-term backup schedule.""" + local_adg_auto_failover_max_data_loss_limit: Optional[int] = rest_field( + name="localAdgAutoFailoverMaxDataLossLimit", visibility=["read", "update"] + ) + """Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to + which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard.""" + open_mode: Optional[Union[str, "_models.OpenModeType"]] = rest_field(name="openMode", visibility=["read", "update"]) + """Indicates the Autonomous Database mode. Known values are: \"ReadOnly\" and \"ReadWrite\".""" + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = rest_field( + name="permissionLevel", visibility=["read", "update"] + ) + """The Autonomous Database permission level. Known values are: \"Restricted\" and + \"Unrestricted\".""" + role: Optional[Union[str, "_models.RoleType"]] = rest_field(visibility=["read", "update"]) + """The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous + Data Guard is enabled. Known values are: \"Primary\", \"Standby\", \"DisabledStandby\", + \"BackupCopy\", and \"SnapshotStandby\".""" + backup_retention_period_in_days: Optional[int] = rest_field( + name="backupRetentionPeriodInDays", visibility=["read", "create", "update"] + ) + """Retention period, in days, for long-term backups.""" + whitelisted_ips: Optional[List[str]] = rest_field(name="whitelistedIps", visibility=["read", "create", "update"]) + """The client IP access control list (ACL). This is an array of CIDR notations and/or IP + addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25'].""" + + @overload + def __init__( + self, + *, + admin_password: Optional[str] = None, + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, + compute_count: Optional[float] = None, + cpu_core_count: Optional[int] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + data_storage_size_in_tbs: Optional[int] = None, + data_storage_size_in_gbs: Optional[int] = None, + display_name: Optional[str] = None, + is_auto_scaling_enabled: Optional[bool] = None, + is_auto_scaling_for_storage_enabled: Optional[bool] = None, + peer_db_id: Optional[str] = None, + is_local_data_guard_enabled: Optional[bool] = None, + is_mtls_connection_required: Optional[bool] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + scheduled_operations: Optional["_models.ScheduledOperationsTypeUpdate"] = None, + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, + local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, + open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, + role: Optional[Union[str, "_models.RoleType"]] = None, + backup_retention_period_in_days: Optional[int] = None, + whitelisted_ips: Optional[List[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDatabaseWalletFile(_Model): + """Autonomous Database Wallet File resource model. + + :ivar wallet_files: The base64 encoded wallet files. Required. + :vartype wallet_files: str + """ + + wallet_files: str = rest_field(name="walletFiles", visibility=["read", "create", "update", "delete", "query"]) + """The base64 encoded wallet files. Required.""" + + @overload + def __init__( + self, + *, + wallet_files: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDbVersion(ProxyResource): + """AutonomousDbVersion resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDbVersionProperties + """ + + properties: Optional["_models.AutonomousDbVersionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.AutonomousDbVersionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutonomousDbVersionProperties(_Model): + """AutonomousDbVersion resource model. + + :ivar version: Supported Autonomous Db versions. Required. + :vartype version: str + :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :ivar is_default_for_free: True if this version of the Oracle Database software's default is + free. + :vartype is_default_for_free: bool + :ivar is_default_for_paid: True if this version of the Oracle Database software's default is + paid. + :vartype is_default_for_paid: bool + :ivar is_free_tier_enabled: True if this version of the Oracle Database software can be used + for Always-Free Autonomous Databases. + :vartype is_free_tier_enabled: bool + :ivar is_paid_enabled: True if this version of the Oracle Database software has payments + enabled. + :vartype is_paid_enabled: bool + """ + + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Supported Autonomous Db versions. Required.""" + db_workload: Optional[Union[str, "_models.WorkloadType"]] = rest_field( + name="dbWorkload", visibility=["read", "create", "update", "delete", "query"] + ) + """The Autonomous Database workload type. Known values are: \"OLTP\", \"DW\", \"AJD\", and + \"APEX\".""" + is_default_for_free: Optional[bool] = rest_field( + name="isDefaultForFree", visibility=["read", "create", "update", "delete", "query"] + ) + """True if this version of the Oracle Database software's default is free.""" + is_default_for_paid: Optional[bool] = rest_field( + name="isDefaultForPaid", visibility=["read", "create", "update", "delete", "query"] + ) + """True if this version of the Oracle Database software's default is paid.""" + is_free_tier_enabled: Optional[bool] = rest_field( + name="isFreeTierEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """True if this version of the Oracle Database software can be used for Always-Free Autonomous + Databases.""" + is_paid_enabled: Optional[bool] = rest_field( + name="isPaidEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """True if this version of the Oracle Database software has payments enabled.""" + + @overload + def __init__( + self, + *, + version: str, + db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, + is_default_for_free: Optional[bool] = None, + is_default_for_paid: Optional[bool] = None, + is_free_tier_enabled: Optional[bool] = None, + is_paid_enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AzureSubscriptions(_Model): + """Azure Subscriptions model. + + :ivar azure_subscription_ids: Azure Subscription Ids to be updated. Required. + :vartype azure_subscription_ids: list[str] + """ + + azure_subscription_ids: List[str] = rest_field( + name="azureSubscriptionIds", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Subscription Ids to be updated. Required.""" + + @overload + def __init__( + self, + *, + azure_subscription_ids: List[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CloudAccountDetails(_Model): + """Cloud Account Details model. + + :ivar cloud_account_name: Cloud Account name. + :vartype cloud_account_name: str + :ivar cloud_account_home_region: Cloud Account Home region. + :vartype cloud_account_home_region: str + """ + + cloud_account_name: Optional[str] = rest_field(name="cloudAccountName", visibility=["read"]) + """Cloud Account name.""" + cloud_account_home_region: Optional[str] = rest_field(name="cloudAccountHomeRegion", visibility=["read"]) + """Cloud Account Home region.""" + + +class CloudExadataInfrastructure(TrackedResource): + """CloudExadataInfrastructure resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureProperties + :ivar zones: CloudExadataInfrastructure zones. Required. + :vartype zones: list[str] + """ + + properties: Optional["_models.CloudExadataInfrastructureProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + zones: List[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """CloudExadataInfrastructure zones. Required.""" + + @overload + def __init__( + self, + *, + location: str, + zones: List[str], + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.CloudExadataInfrastructureProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CloudExadataInfrastructureProperties(_Model): + """CloudExadataInfrastructure resource model. + + :ivar defined_file_system_configuration: Defined file system configurations. + :vartype defined_file_system_configuration: + list[~azure.mgmt.oracledatabase.models.DefinedFileSystemConfiguration] + :ivar ocid: Exadata infra ocid. + :vartype ocid: str + :ivar compute_count: The number of compute servers for the cloud Exadata infrastructure. + :vartype compute_count: int + :ivar storage_count: The number of storage servers for the cloud Exadata infrastructure. + :vartype storage_count: int + :ivar total_storage_size_in_gbs: The total storage allocated to the cloud Exadata + infrastructure resource, in gigabytes (GB). + :vartype total_storage_size_in_gbs: int + :ivar available_storage_size_in_gbs: The available storage can be allocated to the cloud + Exadata infrastructure resource, in gigabytes (GB). + :vartype available_storage_size_in_gbs: int + :ivar time_created: The date and time the cloud Exadata infrastructure resource was created. + :vartype time_created: str + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar maintenance_window: maintenanceWindow property. + :vartype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow + :ivar estimated_patching_time: The estimated total time required in minutes for all patching + operations (database server, storage server, and network switch patching). + :vartype estimated_patching_time: ~azure.mgmt.oracledatabase.models.EstimatedPatchingTime + :ivar customer_contacts: The list of customer email addresses that receive information from + Oracle about the specified OCI Database service resource. Oracle uses these email addresses to + send notifications about planned and unplanned software maintenance updates, information about + system hardware, and other information needed by administrators. Up to 10 email addresses can + be added to the customer contacts for a cloud Exadata infrastructure instance. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar provisioning_state: CloudExadataInfrastructure provisioning state. Known values are: + "Succeeded", "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: CloudExadataInfrastructure lifecycle state. Known values are: + "Provisioning", "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", + and "Failed". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureLifecycleState + :ivar shape: The model name of the cloud Exadata infrastructure resource. Required. + :vartype shape: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar cpu_count: The total number of CPU cores allocated. + :vartype cpu_count: int + :ivar max_cpu_count: The total number of CPU cores available. + :vartype max_cpu_count: int + :ivar memory_size_in_gbs: The memory allocated in GBs. + :vartype memory_size_in_gbs: int + :ivar max_memory_in_gbs: The total memory available in GBs. + :vartype max_memory_in_gbs: int + :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. + :vartype db_node_storage_size_in_gbs: int + :ivar max_db_node_storage_size_in_gbs: The total local node storage available in GBs. + :vartype max_db_node_storage_size_in_gbs: int + :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :vartype data_storage_size_in_tbs: float + :ivar max_data_storage_in_tbs: The total available DATA disk group size. + :vartype max_data_storage_in_tbs: float + :ivar db_server_version: The software version of the database servers (dom0) in the Exadata + infrastructure. + :vartype db_server_version: str + :ivar storage_server_version: The software version of the storage servers (cells) in the + Exadata infrastructure. + :vartype storage_server_version: str + :ivar activated_storage_count: The requested number of additional storage servers activated for + the Exadata infrastructure. + :vartype activated_storage_count: int + :ivar additional_storage_count: The requested number of additional storage servers for the + Exadata infrastructure. + :vartype additional_storage_count: int + :ivar display_name: The name for the Exadata infrastructure. Required. + :vartype display_name: str + :ivar last_maintenance_run_id: The OCID of the last maintenance run. + :vartype last_maintenance_run_id: str + :ivar next_maintenance_run_id: The OCID of the next maintenance run. + :vartype next_maintenance_run_id: str + :ivar monthly_db_server_version: Monthly Db Server version. + :vartype monthly_db_server_version: str + :ivar monthly_storage_server_version: Monthly Storage Server version. + :vartype monthly_storage_server_version: str + :ivar database_server_type: The database server model type of the cloud Exadata infrastructure + resource. + :vartype database_server_type: str + :ivar storage_server_type: The storage server model type of the cloud Exadata infrastructure + resource. + :vartype storage_server_type: str + :ivar compute_model: The compute model of the Exadata Infrastructure. Known values are: "ECPU" + and "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + """ + + defined_file_system_configuration: Optional[List["_models.DefinedFileSystemConfiguration"]] = rest_field( + name="definedFileSystemConfiguration", visibility=["read"] + ) + """Defined file system configurations.""" + ocid: Optional[str] = rest_field(visibility=["read"]) + """Exadata infra ocid.""" + compute_count: Optional[int] = rest_field(name="computeCount", visibility=["read", "create", "update"]) + """The number of compute servers for the cloud Exadata infrastructure.""" + storage_count: Optional[int] = rest_field(name="storageCount", visibility=["read", "create", "update"]) + """The number of storage servers for the cloud Exadata infrastructure.""" + total_storage_size_in_gbs: Optional[int] = rest_field(name="totalStorageSizeInGbs", visibility=["read"]) + """The total storage allocated to the cloud Exadata infrastructure resource, in gigabytes (GB).""" + available_storage_size_in_gbs: Optional[int] = rest_field(name="availableStorageSizeInGbs", visibility=["read"]) + """The available storage can be allocated to the cloud Exadata infrastructure resource, in + gigabytes (GB).""" + time_created: Optional[str] = rest_field(name="timeCreated", visibility=["read"]) + """The date and time the cloud Exadata infrastructure resource was created.""" + lifecycle_details: Optional[str] = rest_field(name="lifecycleDetails", visibility=["read"]) + """Additional information about the current lifecycle state.""" + maintenance_window: Optional["_models.MaintenanceWindow"] = rest_field( + name="maintenanceWindow", visibility=["read", "create", "update"] + ) + """maintenanceWindow property.""" + estimated_patching_time: Optional["_models.EstimatedPatchingTime"] = rest_field( + name="estimatedPatchingTime", visibility=["read"] + ) + """The estimated total time required in minutes for all patching operations (database server, + storage server, and network switch patching).""" + customer_contacts: Optional[List["_models.CustomerContact"]] = rest_field( + name="customerContacts", visibility=["read", "create", "update"] + ) + """The list of customer email addresses that receive information from Oracle about the specified + OCI Database service resource. Oracle uses these email addresses to send notifications about + planned and unplanned software maintenance updates, information about system hardware, and + other information needed by administrators. Up to 10 email addresses can be added to the + customer contacts for a cloud Exadata infrastructure instance.""" + provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """CloudExadataInfrastructure provisioning state. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", and \"Provisioning\".""" + lifecycle_state: Optional[Union[str, "_models.CloudExadataInfrastructureLifecycleState"]] = rest_field( + name="lifecycleState", visibility=["read"] + ) + """CloudExadataInfrastructure lifecycle state. Known values are: \"Provisioning\", \"Available\", + \"Updating\", \"Terminating\", \"Terminated\", \"MaintenanceInProgress\", and \"Failed\".""" + shape: str = rest_field(visibility=["read", "create"]) + """The model name of the cloud Exadata infrastructure resource. Required.""" + oci_url: Optional[str] = rest_field(name="ociUrl", visibility=["read"]) + """HTTPS link to OCI resources exposed to Azure Customer via Azure Interface.""" + cpu_count: Optional[int] = rest_field(name="cpuCount", visibility=["read"]) + """The total number of CPU cores allocated.""" + max_cpu_count: Optional[int] = rest_field(name="maxCpuCount", visibility=["read"]) + """The total number of CPU cores available.""" + memory_size_in_gbs: Optional[int] = rest_field(name="memorySizeInGbs", visibility=["read"]) + """The memory allocated in GBs.""" + max_memory_in_gbs: Optional[int] = rest_field(name="maxMemoryInGbs", visibility=["read"]) + """The total memory available in GBs.""" + db_node_storage_size_in_gbs: Optional[int] = rest_field(name="dbNodeStorageSizeInGbs", visibility=["read"]) + """The local node storage to be allocated in GBs.""" + max_db_node_storage_size_in_gbs: Optional[int] = rest_field(name="maxDbNodeStorageSizeInGbs", visibility=["read"]) + """The total local node storage available in GBs.""" + data_storage_size_in_tbs: Optional[float] = rest_field(name="dataStorageSizeInTbs", visibility=["read"]) + """The quantity of data in the database, in terabytes.""" + max_data_storage_in_tbs: Optional[float] = rest_field(name="maxDataStorageInTbs", visibility=["read"]) + """The total available DATA disk group size.""" + db_server_version: Optional[str] = rest_field(name="dbServerVersion", visibility=["read"]) + """The software version of the database servers (dom0) in the Exadata infrastructure.""" + storage_server_version: Optional[str] = rest_field(name="storageServerVersion", visibility=["read"]) + """The software version of the storage servers (cells) in the Exadata infrastructure.""" + activated_storage_count: Optional[int] = rest_field(name="activatedStorageCount", visibility=["read"]) + """The requested number of additional storage servers activated for the Exadata infrastructure.""" + additional_storage_count: Optional[int] = rest_field(name="additionalStorageCount", visibility=["read"]) + """The requested number of additional storage servers for the Exadata infrastructure.""" + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update"]) + """The name for the Exadata infrastructure. Required.""" + last_maintenance_run_id: Optional[str] = rest_field(name="lastMaintenanceRunId", visibility=["read"]) + """The OCID of the last maintenance run.""" + next_maintenance_run_id: Optional[str] = rest_field(name="nextMaintenanceRunId", visibility=["read"]) + """The OCID of the next maintenance run.""" + monthly_db_server_version: Optional[str] = rest_field(name="monthlyDbServerVersion", visibility=["read"]) + """Monthly Db Server version.""" + monthly_storage_server_version: Optional[str] = rest_field(name="monthlyStorageServerVersion", visibility=["read"]) + """Monthly Storage Server version.""" + database_server_type: Optional[str] = rest_field(name="databaseServerType", visibility=["read", "create"]) + """The database server model type of the cloud Exadata infrastructure resource.""" + storage_server_type: Optional[str] = rest_field(name="storageServerType", visibility=["read", "create"]) + """The storage server model type of the cloud Exadata infrastructure resource.""" + compute_model: Optional[Union[str, "_models.ComputeModel"]] = rest_field(name="computeModel", visibility=["read"]) + """The compute model of the Exadata Infrastructure. Known values are: \"ECPU\" and \"OCPU\".""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + shape: str, + display_name: str, + compute_count: Optional[int] = None, + storage_count: Optional[int] = None, + maintenance_window: Optional["_models.MaintenanceWindow"] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + database_server_type: Optional[str] = None, + storage_server_type: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CloudExadataInfrastructureUpdate(_Model): + """The type used for update operations of the CloudExadataInfrastructure. + + :ivar zones: CloudExadataInfrastructure zones. + :vartype zones: list[str] + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: + ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdateProperties + """ + + zones: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """CloudExadataInfrastructure zones.""" + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.CloudExadataInfrastructureUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + zones: Optional[List[str]] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.CloudExadataInfrastructureUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CloudExadataInfrastructureUpdateProperties(_Model): # pylint: disable=name-too-long + """The updatable properties of the CloudExadataInfrastructure. + + :ivar compute_count: The number of compute servers for the cloud Exadata infrastructure. + :vartype compute_count: int + :ivar storage_count: The number of storage servers for the cloud Exadata infrastructure. + :vartype storage_count: int + :ivar maintenance_window: maintenanceWindow property. + :vartype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow + :ivar customer_contacts: The list of customer email addresses that receive information from + Oracle about the specified OCI Database service resource. Oracle uses these email addresses to + send notifications about planned and unplanned software maintenance updates, information about + system hardware, and other information needed by administrators. Up to 10 email addresses can + be added to the customer contacts for a cloud Exadata infrastructure instance. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar display_name: The name for the Exadata infrastructure. + :vartype display_name: str + """ + + compute_count: Optional[int] = rest_field(name="computeCount", visibility=["read", "create", "update"]) + """The number of compute servers for the cloud Exadata infrastructure.""" + storage_count: Optional[int] = rest_field(name="storageCount", visibility=["read", "create", "update"]) + """The number of storage servers for the cloud Exadata infrastructure.""" + maintenance_window: Optional["_models.MaintenanceWindow"] = rest_field( + name="maintenanceWindow", visibility=["read", "create", "update"] + ) + """maintenanceWindow property.""" + customer_contacts: Optional[List["_models.CustomerContact"]] = rest_field( + name="customerContacts", visibility=["read", "create", "update"] + ) + """The list of customer email addresses that receive information from Oracle about the specified + OCI Database service resource. Oracle uses these email addresses to send notifications about + planned and unplanned software maintenance updates, information about system hardware, and + other information needed by administrators. Up to 10 email addresses can be added to the + customer contacts for a cloud Exadata infrastructure instance.""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read", "create", "update"]) + """The name for the Exadata infrastructure.""" + + @overload + def __init__( + self, + *, + compute_count: Optional[int] = None, + storage_count: Optional[int] = None, + maintenance_window: Optional["_models.MaintenanceWindow"] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + display_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CloudVmCluster(TrackedResource): + """CloudVmCluster resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterProperties + """ + + properties: Optional["_models.CloudVmClusterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.CloudVmClusterProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CloudVmClusterProperties(_Model): + """CloudVmCluster resource model. + + :ivar ocid: Cloud VM Cluster ocid. + :vartype ocid: str + :ivar listener_port: The port number configured for the listener on the cloud VM cluster. + :vartype listener_port: int + :ivar node_count: The number of nodes in the cloud VM cluster. + :vartype node_count: int + :ivar storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. + :vartype storage_size_in_gbs: int + :ivar file_system_configuration_details: Array of mount path and size. + :vartype file_system_configuration_details: + list[~azure.mgmt.oracledatabase.models.FileSystemConfigurationDetails] + :ivar data_storage_size_in_tbs: The data disk group size to be allocated in TBs. + :vartype data_storage_size_in_tbs: float + :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. + :vartype db_node_storage_size_in_gbs: int + :ivar memory_size_in_gbs: The memory to be allocated in GBs. + :vartype memory_size_in_gbs: int + :ivar time_created: The date and time that the cloud VM cluster was created. + :vartype time_created: ~datetime.datetime + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar time_zone: The time zone of the cloud VM cluster. For details, see `Exadata + Infrastructure Time Zones `_. + :vartype time_zone: str + :ivar zone_id: The OCID of the zone the cloud VM cluster is associated with. + :vartype zone_id: str + :ivar hostname: The hostname for the cloud VM cluster. Required. + :vartype hostname: str + :ivar domain: The domain name for the cloud VM cluster. + :vartype domain: str + :ivar cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. Required. + :vartype cpu_core_count: int + :ivar ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal + place is allowed for the fractional part. + :vartype ocpu_count: float + :ivar cluster_name: The cluster name for cloud VM cluster. The cluster name must begin with an + alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The + cluster name can be no longer than 11 characters and is not case sensitive. + :vartype cluster_name: str + :ivar data_storage_percentage: The percentage assigned to DATA storage (user data and database + files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, + and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default is 80 percent + assigned to DATA storage. See `Storage Configuration + `_ in the Exadata documentation for details + on the impact of the configuration settings on storage. + :vartype data_storage_percentage: int + :ivar is_local_backup_enabled: If true, database backup on local Exadata storage is configured + for the cloud VM cluster. If false, database backup on local Exadata storage is not available + in the cloud VM cluster. + :vartype is_local_backup_enabled: bool + :ivar cloud_exadata_infrastructure_id: Cloud Exadata Infrastructure ID. Required. + :vartype cloud_exadata_infrastructure_id: str + :ivar is_sparse_diskgroup_enabled: If true, sparse disk group is configured for the cloud VM + cluster. If false, sparse disk group is not created. + :vartype is_sparse_diskgroup_enabled: bool + :ivar system_version: Operating system version of the image. + :vartype system_version: str + :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to + the cloud VM cluster. Required. + :vartype ssh_public_keys: list[str] + :ivar license_model: The Oracle license model that applies to the cloud VM cluster. The default + is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar disk_redundancy: The type of redundancy configured for the cloud Vm cluster. NORMAL is + 2-way redundancy. HIGH is 3-way redundancy. Known values are: "High" and "Normal". + :vartype disk_redundancy: str or ~azure.mgmt.oracledatabase.models.DiskRedundancy + :ivar scan_ip_ids: The Single Client Access Name (SCAN) IP addresses associated with the cloud + VM cluster. SCAN IP addresses are typically used for load balancing and are not assigned to any + interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. + **Note:** For a single-node DB system, this list is empty. + :vartype scan_ip_ids: list[str] + :ivar vip_ids: The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster + Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud + Service instance to enable failover. If one node fails, the VIP is reassigned to another active + node in the cluster. **Note:** For a single-node DB system, this list is empty. + :vartype vip_ids: list[str] + :ivar scan_dns_name: The FQDN of the DNS record for the SCAN IP addresses that are associated + with the cloud VM cluster. + :vartype scan_dns_name: str + :ivar scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default port + is 1521. + :vartype scan_listener_port_tcp: int + :ivar scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The default + port is 2484. + :vartype scan_listener_port_tcp_ssl: int + :ivar scan_dns_record_id: The OCID of the DNS record for the SCAN IP addresses that are + associated with the cloud VM cluster. + :vartype scan_dns_record_id: str + :ivar shape: The model name of the Exadata hardware running the cloud VM cluster. + :vartype shape: str + :ivar provisioning_state: CloudVmCluster provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: CloudVmCluster lifecycle state. Known values are: "Provisioning", + "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.CloudVmClusterLifecycleState + :ivar vnet_id: VNET for network connectivity. Required. + :vartype vnet_id: str + :ivar gi_version: Oracle Grid Infrastructure (GI) software version. Required. + :vartype gi_version: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar nsg_url: HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure + Interface. + :vartype nsg_url: str + :ivar subnet_id: Client subnet. Required. + :vartype subnet_id: str + :ivar backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. + :vartype backup_subnet_cidr: str + :ivar nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision + the VM Cluster will be added by default. + :vartype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] + :ivar data_collection_options: Indicates user preferences for the various diagnostic collection + options for the VM cluster/Cloud VM cluster/VMBM DBCS. + :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions + :ivar display_name: Display Name. Required. + :vartype display_name: str + :ivar compute_nodes: The list of compute servers to be added to the cloud VM cluster. + :vartype compute_nodes: list[str] + :ivar iorm_config_cache: iormConfigCache details for cloud VM cluster. + :vartype iorm_config_cache: ~azure.mgmt.oracledatabase.models.ExadataIormConfig + :ivar last_update_history_entry_id: The OCID of the last maintenance update history entry. + :vartype last_update_history_entry_id: str + :ivar db_servers: The list of DB servers. + :vartype db_servers: list[str] + :ivar compartment_id: Cluster compartmentId. + :vartype compartment_id: str + :ivar subnet_ocid: Cluster subnet ocid. + :vartype subnet_ocid: str + :ivar compute_model: The compute model of the VM Cluster. Known values are: "ECPU" and "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + """ + + ocid: Optional[str] = rest_field(visibility=["read"]) + """Cloud VM Cluster ocid.""" + listener_port: Optional[int] = rest_field(name="listenerPort", visibility=["read"]) + """The port number configured for the listener on the cloud VM cluster.""" + node_count: Optional[int] = rest_field(name="nodeCount", visibility=["read"]) + """The number of nodes in the cloud VM cluster.""" + storage_size_in_gbs: Optional[int] = rest_field(name="storageSizeInGbs", visibility=["read", "update"]) + """The data disk group size to be allocated in GBs per VM.""" + file_system_configuration_details: Optional[List["_models.FileSystemConfigurationDetails"]] = rest_field( + name="fileSystemConfigurationDetails", visibility=["read", "update"] + ) + """Array of mount path and size.""" + data_storage_size_in_tbs: Optional[float] = rest_field( + name="dataStorageSizeInTbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The data disk group size to be allocated in TBs.""" + db_node_storage_size_in_gbs: Optional[int] = rest_field( + name="dbNodeStorageSizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The local node storage to be allocated in GBs.""" + memory_size_in_gbs: Optional[int] = rest_field( + name="memorySizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The memory to be allocated in GBs.""" + time_created: Optional[datetime.datetime] = rest_field(name="timeCreated", visibility=["read"], format="rfc3339") + """The date and time that the cloud VM cluster was created.""" + lifecycle_details: Optional[str] = rest_field(name="lifecycleDetails", visibility=["read"]) + """Additional information about the current lifecycle state.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create"]) + """The time zone of the cloud VM cluster. For details, see `Exadata Infrastructure Time Zones + `_.""" + zone_id: Optional[str] = rest_field(name="zoneId", visibility=["read", "create"]) + """The OCID of the zone the cloud VM cluster is associated with.""" + hostname: str = rest_field(visibility=["read", "create"]) + """The hostname for the cloud VM cluster. Required.""" + domain: Optional[str] = rest_field(visibility=["read", "create"]) + """The domain name for the cloud VM cluster.""" + cpu_core_count: int = rest_field(name="cpuCoreCount", visibility=["read", "create", "update", "delete", "query"]) + """The number of CPU cores enabled on the cloud VM cluster. Required.""" + ocpu_count: Optional[float] = rest_field( + name="ocpuCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for + the fractional part.""" + cluster_name: Optional[str] = rest_field(name="clusterName", visibility=["read", "create"]) + """The cluster name for cloud VM cluster. The cluster name must begin with an alphabetic + character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can + be no longer than 11 characters and is not case sensitive.""" + data_storage_percentage: Optional[int] = rest_field(name="dataStoragePercentage", visibility=["read", "create"]) + """The percentage assigned to DATA storage (user data and database files). The remaining + percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager + backups). Accepted values are 35, 40, 60 and 80. The default is 80 percent assigned to DATA + storage. See `Storage Configuration `_ in + the Exadata documentation for details on the impact of the configuration settings on storage.""" + is_local_backup_enabled: Optional[bool] = rest_field(name="isLocalBackupEnabled", visibility=["read", "create"]) + """If true, database backup on local Exadata storage is configured for the cloud VM cluster. If + false, database backup on local Exadata storage is not available in the cloud VM cluster.""" + cloud_exadata_infrastructure_id: str = rest_field( + name="cloudExadataInfrastructureId", visibility=["read", "create"] + ) + """Cloud Exadata Infrastructure ID. Required.""" + is_sparse_diskgroup_enabled: Optional[bool] = rest_field( + name="isSparseDiskgroupEnabled", visibility=["read", "create"] + ) + """If true, sparse disk group is configured for the cloud VM cluster. If false, sparse disk group + is not created.""" + system_version: Optional[str] = rest_field(name="systemVersion", visibility=["read", "create"]) + """Operating system version of the image.""" + ssh_public_keys: List[str] = rest_field( + name="sshPublicKeys", visibility=["read", "create", "update", "delete", "query"] + ) + """The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + Required.""" + license_model: Optional[Union[str, "_models.LicenseModel"]] = rest_field( + name="licenseModel", visibility=["read", "create", "update", "delete", "query"] + ) + """The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + Known values are: \"LicenseIncluded\" and \"BringYourOwnLicense\".""" + disk_redundancy: Optional[Union[str, "_models.DiskRedundancy"]] = rest_field( + name="diskRedundancy", visibility=["read"] + ) + """The type of redundancy configured for the cloud Vm cluster. NORMAL is 2-way redundancy. HIGH is + 3-way redundancy. Known values are: \"High\" and \"Normal\".""" + scan_ip_ids: Optional[List[str]] = rest_field(name="scanIpIds", visibility=["read"]) + """The Single Client Access Name (SCAN) IP addresses associated with the cloud VM cluster. SCAN IP + addresses are typically used for load balancing and are not assigned to any interface. Oracle + Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a + single-node DB system, this list is empty.""" + vip_ids: Optional[List[str]] = rest_field(name="vipIds", visibility=["read"]) + """The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster Ready Services + (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance + to enable failover. If one node fails, the VIP is reassigned to another active node in the + cluster. **Note:** For a single-node DB system, this list is empty.""" + scan_dns_name: Optional[str] = rest_field(name="scanDnsName", visibility=["read"]) + """The FQDN of the DNS record for the SCAN IP addresses that are associated with the cloud VM + cluster.""" + scan_listener_port_tcp: Optional[int] = rest_field(name="scanListenerPortTcp", visibility=["read", "create"]) + """The TCP Single Client Access Name (SCAN) port. The default port is 1521.""" + scan_listener_port_tcp_ssl: Optional[int] = rest_field(name="scanListenerPortTcpSsl", visibility=["read", "create"]) + """The TCPS Single Client Access Name (SCAN) port. The default port is 2484.""" + scan_dns_record_id: Optional[str] = rest_field(name="scanDnsRecordId", visibility=["read"]) + """The OCID of the DNS record for the SCAN IP addresses that are associated with the cloud VM + cluster.""" + shape: Optional[str] = rest_field(visibility=["read"]) + """The model name of the Exadata hardware running the cloud VM cluster.""" + provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """CloudVmCluster provisioning state. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + and \"Provisioning\".""" + lifecycle_state: Optional[Union[str, "_models.CloudVmClusterLifecycleState"]] = rest_field( + name="lifecycleState", visibility=["read"] + ) + """CloudVmCluster lifecycle state. Known values are: \"Provisioning\", \"Available\", + \"Updating\", \"Terminating\", \"Terminated\", \"MaintenanceInProgress\", and \"Failed\".""" + vnet_id: str = rest_field(name="vnetId", visibility=["read", "create"]) + """VNET for network connectivity. Required.""" + gi_version: str = rest_field(name="giVersion", visibility=["read", "create"]) + """Oracle Grid Infrastructure (GI) software version. Required.""" + oci_url: Optional[str] = rest_field(name="ociUrl", visibility=["read"]) + """HTTPS link to OCI resources exposed to Azure Customer via Azure Interface.""" + nsg_url: Optional[str] = rest_field(name="nsgUrl", visibility=["read"]) + """HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface.""" + subnet_id: str = rest_field(name="subnetId", visibility=["read", "create"]) + """Client subnet. Required.""" + backup_subnet_cidr: Optional[str] = rest_field(name="backupSubnetCidr", visibility=["read", "create"]) + """Client OCI backup subnet CIDR, default is 192.168.252.0/22.""" + nsg_cidrs: Optional[List["_models.NsgCidr"]] = rest_field(name="nsgCidrs", visibility=["read", "create"]) + """CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster + will be added by default.""" + data_collection_options: Optional["_models.DataCollectionOptions"] = rest_field( + name="dataCollectionOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates user preferences for the various diagnostic collection options for the VM + cluster/Cloud VM cluster/VMBM DBCS.""" + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) + """Display Name. Required.""" + compute_nodes: Optional[List[str]] = rest_field(name="computeNodes", visibility=["update"]) + """The list of compute servers to be added to the cloud VM cluster.""" + iorm_config_cache: Optional["_models.ExadataIormConfig"] = rest_field(name="iormConfigCache", visibility=["read"]) + """iormConfigCache details for cloud VM cluster.""" + last_update_history_entry_id: Optional[str] = rest_field(name="lastUpdateHistoryEntryId", visibility=["read"]) + """The OCID of the last maintenance update history entry.""" + db_servers: Optional[List[str]] = rest_field(name="dbServers", visibility=["read", "create"]) + """The list of DB servers.""" + compartment_id: Optional[str] = rest_field(name="compartmentId", visibility=["read"]) + """Cluster compartmentId.""" + subnet_ocid: Optional[str] = rest_field(name="subnetOcid", visibility=["read"]) + """Cluster subnet ocid.""" + compute_model: Optional[Union[str, "_models.ComputeModel"]] = rest_field(name="computeModel", visibility=["read"]) + """The compute model of the VM Cluster. Known values are: \"ECPU\" and \"OCPU\".""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + hostname: str, + cpu_core_count: int, + cloud_exadata_infrastructure_id: str, + ssh_public_keys: List[str], + vnet_id: str, + gi_version: str, + subnet_id: str, + display_name: str, + storage_size_in_gbs: Optional[int] = None, + file_system_configuration_details: Optional[List["_models.FileSystemConfigurationDetails"]] = None, + data_storage_size_in_tbs: Optional[float] = None, + db_node_storage_size_in_gbs: Optional[int] = None, + memory_size_in_gbs: Optional[int] = None, + time_zone: Optional[str] = None, + zone_id: Optional[str] = None, + domain: Optional[str] = None, + ocpu_count: Optional[float] = None, + cluster_name: Optional[str] = None, + data_storage_percentage: Optional[int] = None, + is_local_backup_enabled: Optional[bool] = None, + is_sparse_diskgroup_enabled: Optional[bool] = None, + system_version: Optional[str] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + scan_listener_port_tcp: Optional[int] = None, + scan_listener_port_tcp_ssl: Optional[int] = None, + backup_subnet_cidr: Optional[str] = None, + nsg_cidrs: Optional[List["_models.NsgCidr"]] = None, + data_collection_options: Optional["_models.DataCollectionOptions"] = None, + compute_nodes: Optional[List[str]] = None, + db_servers: Optional[List[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CloudVmClusterUpdate(_Model): + """The type used for update operations of the CloudVmCluster. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdateProperties + """ + + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.CloudVmClusterUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.CloudVmClusterUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CloudVmClusterUpdateProperties(_Model): + """The updatable properties of the CloudVmCluster. + + :ivar storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. + :vartype storage_size_in_gbs: int + :ivar file_system_configuration_details: Array of mount path and size. + :vartype file_system_configuration_details: + list[~azure.mgmt.oracledatabase.models.FileSystemConfigurationDetails] + :ivar data_storage_size_in_tbs: The data disk group size to be allocated in TBs. + :vartype data_storage_size_in_tbs: float + :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. + :vartype db_node_storage_size_in_gbs: int + :ivar memory_size_in_gbs: The memory to be allocated in GBs. + :vartype memory_size_in_gbs: int + :ivar cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. + :vartype cpu_core_count: int + :ivar ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal + place is allowed for the fractional part. + :vartype ocpu_count: float + :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to + the cloud VM cluster. + :vartype ssh_public_keys: list[str] + :ivar license_model: The Oracle license model that applies to the cloud VM cluster. The default + is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar data_collection_options: Indicates user preferences for the various diagnostic collection + options for the VM cluster/Cloud VM cluster/VMBM DBCS. + :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions + :ivar display_name: Display Name. + :vartype display_name: str + :ivar compute_nodes: The list of compute servers to be added to the cloud VM cluster. + :vartype compute_nodes: list[str] + """ + + storage_size_in_gbs: Optional[int] = rest_field(name="storageSizeInGbs", visibility=["read", "update"]) + """The data disk group size to be allocated in GBs per VM.""" + file_system_configuration_details: Optional[List["_models.FileSystemConfigurationDetails"]] = rest_field( + name="fileSystemConfigurationDetails", visibility=["read", "update"] + ) + """Array of mount path and size.""" + data_storage_size_in_tbs: Optional[float] = rest_field( + name="dataStorageSizeInTbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The data disk group size to be allocated in TBs.""" + db_node_storage_size_in_gbs: Optional[int] = rest_field( + name="dbNodeStorageSizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The local node storage to be allocated in GBs.""" + memory_size_in_gbs: Optional[int] = rest_field( + name="memorySizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The memory to be allocated in GBs.""" + cpu_core_count: Optional[int] = rest_field( + name="cpuCoreCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of CPU cores enabled on the cloud VM cluster.""" + ocpu_count: Optional[float] = rest_field( + name="ocpuCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for + the fractional part.""" + ssh_public_keys: Optional[List[str]] = rest_field( + name="sshPublicKeys", visibility=["read", "create", "update", "delete", "query"] + ) + """The public key portion of one or more key pairs used for SSH access to the cloud VM cluster.""" + license_model: Optional[Union[str, "_models.LicenseModel"]] = rest_field( + name="licenseModel", visibility=["read", "create", "update", "delete", "query"] + ) + """The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + Known values are: \"LicenseIncluded\" and \"BringYourOwnLicense\".""" + data_collection_options: Optional["_models.DataCollectionOptions"] = rest_field( + name="dataCollectionOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates user preferences for the various diagnostic collection options for the VM + cluster/Cloud VM cluster/VMBM DBCS.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Display Name.""" + compute_nodes: Optional[List[str]] = rest_field(name="computeNodes", visibility=["update"]) + """The list of compute servers to be added to the cloud VM cluster.""" + + @overload + def __init__( + self, + *, + storage_size_in_gbs: Optional[int] = None, + file_system_configuration_details: Optional[List["_models.FileSystemConfigurationDetails"]] = None, + data_storage_size_in_tbs: Optional[float] = None, + db_node_storage_size_in_gbs: Optional[int] = None, + memory_size_in_gbs: Optional[int] = None, + cpu_core_count: Optional[int] = None, + ocpu_count: Optional[float] = None, + ssh_public_keys: Optional[List[str]] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + data_collection_options: Optional["_models.DataCollectionOptions"] = None, + display_name: Optional[str] = None, + compute_nodes: Optional[List[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConnectionStringType(_Model): + """Connection strings to connect to an Oracle Autonomous Database. + + :ivar all_connection_strings: Returns all connection strings that can be used to connect to the + Autonomous Database. + :vartype all_connection_strings: ~azure.mgmt.oracledatabase.models.AllConnectionStringType + :ivar dedicated: The database service provides the least level of resources to each SQL + statement, but supports the most number of concurrent SQL statements. + :vartype dedicated: str + :ivar high: The High database service provides the highest level of resources to each SQL + statement resulting in the highest performance, but supports the fewest number of concurrent + SQL statements. + :vartype high: str + :ivar low: The Low database service provides the least level of resources to each SQL + statement, but supports the most number of concurrent SQL statements. + :vartype low: str + :ivar medium: The Medium database service provides a lower level of resources to each SQL + statement potentially resulting a lower level of performance, but supports more concurrent SQL + statements. + :vartype medium: str + :ivar profiles: A list of connection string profiles to allow clients to group, filter and + select connection string values based on structured metadata. + :vartype profiles: list[~azure.mgmt.oracledatabase.models.ProfileType] + """ + + all_connection_strings: Optional["_models.AllConnectionStringType"] = rest_field( + name="allConnectionStrings", visibility=["read", "create", "update", "delete", "query"] + ) + """Returns all connection strings that can be used to connect to the Autonomous Database.""" + dedicated: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The database service provides the least level of resources to each SQL statement, but supports + the most number of concurrent SQL statements.""" + high: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The High database service provides the highest level of resources to each SQL statement + resulting in the highest performance, but supports the fewest number of concurrent SQL + statements.""" + low: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Low database service provides the least level of resources to each SQL statement, but + supports the most number of concurrent SQL statements.""" + medium: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Medium database service provides a lower level of resources to each SQL statement + potentially resulting a lower level of performance, but supports more concurrent SQL + statements.""" + profiles: Optional[List["_models.ProfileType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A list of connection string profiles to allow clients to group, filter and select connection + string values based on structured metadata.""" + + @overload + def __init__( + self, + *, + all_connection_strings: Optional["_models.AllConnectionStringType"] = None, + dedicated: Optional[str] = None, + high: Optional[str] = None, + low: Optional[str] = None, + medium: Optional[str] = None, + profiles: Optional[List["_models.ProfileType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConnectionUrlType(_Model): + """The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser + from a Compute instance within your VCN or that has a direct connection to your VCN. + + :ivar apex_url: Oracle Application Express (APEX) URL. + :vartype apex_url: str + :ivar database_transforms_url: The URL of the Database Transforms for the Autonomous Database. + :vartype database_transforms_url: str + :ivar graph_studio_url: The URL of the Graph Studio for the Autonomous Database. + :vartype graph_studio_url: str + :ivar machine_learning_notebook_url: The URL of the Oracle Machine Learning (OML) Notebook for + the Autonomous Database. + :vartype machine_learning_notebook_url: str + :ivar mongo_db_url: The URL of the MongoDB API for the Autonomous Database. + :vartype mongo_db_url: str + :ivar ords_url: The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous + Database. + :vartype ords_url: str + :ivar sql_dev_web_url: Oracle SQL Developer Web URL. + :vartype sql_dev_web_url: str + """ + + apex_url: Optional[str] = rest_field(name="apexUrl", visibility=["read", "create", "update", "delete", "query"]) + """Oracle Application Express (APEX) URL.""" + database_transforms_url: Optional[str] = rest_field( + name="databaseTransformsUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """The URL of the Database Transforms for the Autonomous Database.""" + graph_studio_url: Optional[str] = rest_field( + name="graphStudioUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """The URL of the Graph Studio for the Autonomous Database.""" + machine_learning_notebook_url: Optional[str] = rest_field( + name="machineLearningNotebookUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """The URL of the Oracle Machine Learning (OML) Notebook for the Autonomous Database.""" + mongo_db_url: Optional[str] = rest_field( + name="mongoDbUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """The URL of the MongoDB API for the Autonomous Database.""" + ords_url: Optional[str] = rest_field(name="ordsUrl", visibility=["read", "create", "update", "delete", "query"]) + """The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous Database.""" + sql_dev_web_url: Optional[str] = rest_field( + name="sqlDevWebUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Oracle SQL Developer Web URL.""" + + @overload + def __init__( + self, + *, + apex_url: Optional[str] = None, + database_transforms_url: Optional[str] = None, + graph_studio_url: Optional[str] = None, + machine_learning_notebook_url: Optional[str] = None, + mongo_db_url: Optional[str] = None, + ords_url: Optional[str] = None, + sql_dev_web_url: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CustomerContact(_Model): + """CustomerContact resource properties. + + :ivar email: The email address used by Oracle to send notifications regarding databases and + infrastructure. Required. + :vartype email: str + """ + + email: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The email address used by Oracle to send notifications regarding databases and infrastructure. + Required.""" + + @overload + def __init__( + self, + *, + email: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataCollectionOptions(_Model): + """DataCollectionOptions resource properties. + + :ivar is_diagnostics_events_enabled: Indicates whether diagnostic collection is enabled for the + VM cluster/Cloud VM cluster/VMBM DBCS. + :vartype is_diagnostics_events_enabled: bool + :ivar is_health_monitoring_enabled: Indicates whether health monitoring is enabled for the VM + cluster / Cloud VM cluster / VMBM DBCS. + :vartype is_health_monitoring_enabled: bool + :ivar is_incident_logs_enabled: Indicates whether incident logs and trace collection are + enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. + :vartype is_incident_logs_enabled: bool + """ + + is_diagnostics_events_enabled: Optional[bool] = rest_field( + name="isDiagnosticsEventsEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether diagnostic collection is enabled for the VM cluster/Cloud VM cluster/VMBM + DBCS.""" + is_health_monitoring_enabled: Optional[bool] = rest_field( + name="isHealthMonitoringEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether health monitoring is enabled for the VM cluster / Cloud VM cluster / VMBM + DBCS.""" + is_incident_logs_enabled: Optional[bool] = rest_field( + name="isIncidentLogsEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether incident logs and trace collection are enabled for the VM cluster / Cloud VM + cluster / VMBM DBCS.""" + + @overload + def __init__( + self, + *, + is_diagnostics_events_enabled: Optional[bool] = None, + is_health_monitoring_enabled: Optional[bool] = None, + is_incident_logs_enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DayOfWeek(_Model): + """DayOfWeek resource properties. + + :ivar name: Name of the day of the week. Required. Known values are: "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :vartype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName + """ + + name: Union[str, "_models.DayOfWeekName"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the day of the week. Required. Known values are: \"Monday\", \"Tuesday\", + \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", and \"Sunday\".""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.DayOfWeekName"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DayOfWeekUpdate(_Model): + """DayOfWeek resource properties. + + :ivar name: Name of the day of the week. Required. Known values are: "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :vartype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName + """ + + name: Union[str, "_models.DayOfWeekName"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the day of the week. Required. Known values are: \"Monday\", \"Tuesday\", + \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", and \"Sunday\".""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.DayOfWeekName"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DbActionResponse(_Model): + """ExascaleDbNode action response. + + :ivar provisioning_state: ExascaleDbNode provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + """ + + provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read", "create", "update", "delete", "query"] + ) + """ExascaleDbNode provisioning state. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + and \"Provisioning\".""" + + @overload + def __init__( + self, + *, + provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DbIormConfig(_Model): + """DbIormConfig for cloud vm cluster. + + :ivar db_name: The database name. For the default DbPlan, the dbName is default. + :vartype db_name: str + :ivar flash_cache_limit: The flash cache limit for this database. This value is internally + configured based on the share value assigned to the database. + :vartype flash_cache_limit: str + :ivar share: The relative priority of this database. + :vartype share: int + """ + + db_name: Optional[str] = rest_field(name="dbName", visibility=["read", "create", "update", "delete", "query"]) + """The database name. For the default DbPlan, the dbName is default.""" + flash_cache_limit: Optional[str] = rest_field( + name="flashCacheLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """The flash cache limit for this database. This value is internally configured based on the share + value assigned to the database.""" + share: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The relative priority of this database.""" + + @overload + def __init__( + self, + *, + db_name: Optional[str] = None, + flash_cache_limit: Optional[str] = None, + share: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DbNode(ProxyResource): + """The DbNode resource belonging to vmCluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.DbNodeProperties + """ + + properties: Optional["_models.DbNodeProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.DbNodeProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DbNodeAction(_Model): + """DbNode action object. + + :ivar action: Db action. Required. Known values are: "Start", "Stop", "SoftReset", and "Reset". + :vartype action: str or ~azure.mgmt.oracledatabase.models.DbNodeActionEnum + """ + + action: Union[str, "_models.DbNodeActionEnum"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Db action. Required. Known values are: \"Start\", \"Stop\", \"SoftReset\", and \"Reset\".""" + + @overload + def __init__( + self, + *, + action: Union[str, "_models.DbNodeActionEnum"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DbNodeDetails(_Model): + """Details of the ExaCS Db node. Applies to Exadata Database Service on Exascale Infrastructure + only. + + :ivar db_node_id: Exascale DbNode Azure Resource ID. Required. + :vartype db_node_id: str + """ + + db_node_id: str = rest_field(name="dbNodeId", visibility=["read", "create", "update", "delete", "query"]) + """Exascale DbNode Azure Resource ID. Required.""" + + @overload + def __init__( + self, + *, + db_node_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DbNodeProperties(_Model): + """The properties of DbNodeResource. + + :ivar ocid: DbNode OCID. Required. + :vartype ocid: str + :ivar additional_details: Additional information about the planned maintenance. + :vartype additional_details: str + :ivar backup_ip_id: The OCID of the backup IP address associated with the database node. + :vartype backup_ip_id: str + :ivar backup_vnic2_id: The OCID of the second backup VNIC. + :vartype backup_vnic2_id: str + :ivar backup_vnic_id: The OCID of the backup VNIC. + :vartype backup_vnic_id: str + :ivar cpu_core_count: The number of CPU cores enabled on the Db node. + :vartype cpu_core_count: int + :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db node. + :vartype db_node_storage_size_in_gbs: int + :ivar db_server_id: The OCID of the Exacc Db server associated with the database node. + :vartype db_server_id: str + :ivar db_system_id: The OCID of the DB system. Required. + :vartype db_system_id: str + :ivar fault_domain: The name of the Fault Domain the instance is contained in. + :vartype fault_domain: str + :ivar host_ip_id: The OCID of the host IP address associated with the database node. + :vartype host_ip_id: str + :ivar hostname: The host name for the database node. + :vartype hostname: str + :ivar lifecycle_state: The current state of the database node. Required. Known values are: + "Provisioning", "Available", "Updating", "Stopping", "Stopped", "Starting", "Terminating", + "Terminated", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbNodeProvisioningState + :ivar lifecycle_details: Lifecycle details of Db Node. + :vartype lifecycle_details: str + :ivar maintenance_type: The type of database node maintenance. "VmdbRebootMigration" + :vartype maintenance_type: str or ~azure.mgmt.oracledatabase.models.DbNodeMaintenanceType + :ivar memory_size_in_gbs: The allocated memory in GBs on the Db node. + :vartype memory_size_in_gbs: int + :ivar software_storage_size_in_gb: The size (in GB) of the block storage volume allocation for + the DB system. This attribute applies only for virtual machine DB systems. + :vartype software_storage_size_in_gb: int + :ivar time_created: The date and time that the database node was created. Required. + :vartype time_created: ~datetime.datetime + :ivar time_maintenance_window_end: End date and time of maintenance window. + :vartype time_maintenance_window_end: ~datetime.datetime + :ivar time_maintenance_window_start: Start date and time of maintenance window. + :vartype time_maintenance_window_start: ~datetime.datetime + :ivar vnic2_id: The OCID of the second VNIC. + :vartype vnic2_id: str + :ivar vnic_id: The OCID of the VNIC. Required. + :vartype vnic_id: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState + """ + + ocid: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """DbNode OCID. Required.""" + additional_details: Optional[str] = rest_field( + name="additionalDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional information about the planned maintenance.""" + backup_ip_id: Optional[str] = rest_field( + name="backupIpId", visibility=["read", "create", "update", "delete", "query"] + ) + """The OCID of the backup IP address associated with the database node.""" + backup_vnic2_id: Optional[str] = rest_field( + name="backupVnic2Id", visibility=["read", "create", "update", "delete", "query"] + ) + """The OCID of the second backup VNIC.""" + backup_vnic_id: Optional[str] = rest_field( + name="backupVnicId", visibility=["read", "create", "update", "delete", "query"] + ) + """The OCID of the backup VNIC.""" + cpu_core_count: Optional[int] = rest_field( + name="cpuCoreCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of CPU cores enabled on the Db node.""" + db_node_storage_size_in_gbs: Optional[int] = rest_field( + name="dbNodeStorageSizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The allocated local node storage in GBs on the Db node.""" + db_server_id: Optional[str] = rest_field( + name="dbServerId", visibility=["read", "create", "update", "delete", "query"] + ) + """The OCID of the Exacc Db server associated with the database node.""" + db_system_id: str = rest_field(name="dbSystemId", visibility=["read", "create", "update", "delete", "query"]) + """The OCID of the DB system. Required.""" + fault_domain: Optional[str] = rest_field( + name="faultDomain", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the Fault Domain the instance is contained in.""" + host_ip_id: Optional[str] = rest_field(name="hostIpId", visibility=["read", "create", "update", "delete", "query"]) + """The OCID of the host IP address associated with the database node.""" + hostname: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The host name for the database node.""" + lifecycle_state: Union[str, "_models.DbNodeProvisioningState"] = rest_field( + name="lifecycleState", visibility=["read", "create", "update", "delete", "query"] + ) + """The current state of the database node. Required. Known values are: \"Provisioning\", + \"Available\", \"Updating\", \"Stopping\", \"Stopped\", \"Starting\", \"Terminating\", + \"Terminated\", and \"Failed\".""" + lifecycle_details: Optional[str] = rest_field( + name="lifecycleDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Lifecycle details of Db Node.""" + maintenance_type: Optional[Union[str, "_models.DbNodeMaintenanceType"]] = rest_field( + name="maintenanceType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of database node maintenance. \"VmdbRebootMigration\"""" + memory_size_in_gbs: Optional[int] = rest_field( + name="memorySizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The allocated memory in GBs on the Db node.""" + software_storage_size_in_gb: Optional[int] = rest_field( + name="softwareStorageSizeInGb", visibility=["read", "create", "update", "delete", "query"] + ) + """The size (in GB) of the block storage volume allocation for the DB system. This attribute + applies only for virtual machine DB systems.""" + time_created: datetime.datetime = rest_field( + name="timeCreated", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The date and time that the database node was created. Required.""" + time_maintenance_window_end: Optional[datetime.datetime] = rest_field( + name="timeMaintenanceWindowEnd", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """End date and time of maintenance window.""" + time_maintenance_window_start: Optional[datetime.datetime] = rest_field( + name="timeMaintenanceWindowStart", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Start date and time of maintenance window.""" + vnic2_id: Optional[str] = rest_field(name="vnic2Id", visibility=["read", "create", "update", "delete", "query"]) + """The OCID of the second VNIC.""" + vnic_id: str = rest_field(name="vnicId", visibility=["read", "create", "update", "delete", "query"]) + """The OCID of the VNIC. Required.""" + provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Azure resource provisioning state. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + @overload + def __init__( + self, + *, + ocid: str, + db_system_id: str, + lifecycle_state: Union[str, "_models.DbNodeProvisioningState"], + time_created: datetime.datetime, + vnic_id: str, + additional_details: Optional[str] = None, + backup_ip_id: Optional[str] = None, + backup_vnic2_id: Optional[str] = None, + backup_vnic_id: Optional[str] = None, + cpu_core_count: Optional[int] = None, + db_node_storage_size_in_gbs: Optional[int] = None, + db_server_id: Optional[str] = None, + fault_domain: Optional[str] = None, + host_ip_id: Optional[str] = None, + hostname: Optional[str] = None, + lifecycle_details: Optional[str] = None, + maintenance_type: Optional[Union[str, "_models.DbNodeMaintenanceType"]] = None, + memory_size_in_gbs: Optional[int] = None, + software_storage_size_in_gb: Optional[int] = None, + time_maintenance_window_end: Optional[datetime.datetime] = None, + time_maintenance_window_start: Optional[datetime.datetime] = None, + vnic2_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DbServer(ProxyResource): + """DbServer resource model. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.DbServerProperties + """ + + properties: Optional["_models.DbServerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.DbServerProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DbServerPatchingDetails(_Model): + """DbServer Patching Properties. + + :ivar estimated_patch_duration: Estimated Patch Duration. + :vartype estimated_patch_duration: int + :ivar patching_status: Patching Status. Known values are: "Scheduled", "MaintenanceInProgress", + "Failed", and "Complete". + :vartype patching_status: str or ~azure.mgmt.oracledatabase.models.DbServerPatchingStatus + :ivar time_patching_ended: Time Patching Ended. + :vartype time_patching_ended: ~datetime.datetime + :ivar time_patching_started: Time Patching Started. + :vartype time_patching_started: ~datetime.datetime + """ + + estimated_patch_duration: Optional[int] = rest_field(name="estimatedPatchDuration", visibility=["read"]) + """Estimated Patch Duration.""" + patching_status: Optional[Union[str, "_models.DbServerPatchingStatus"]] = rest_field( + name="patchingStatus", visibility=["read"] + ) + """Patching Status. Known values are: \"Scheduled\", \"MaintenanceInProgress\", \"Failed\", and + \"Complete\".""" + time_patching_ended: Optional[datetime.datetime] = rest_field( + name="timePatchingEnded", visibility=["read"], format="rfc3339" + ) + """Time Patching Ended.""" + time_patching_started: Optional[datetime.datetime] = rest_field( + name="timePatchingStarted", visibility=["read"], format="rfc3339" + ) + """Time Patching Started.""" + + +class DbServerProperties(_Model): + """DbServer resource properties. + + :ivar ocid: Db server name. + :vartype ocid: str + :ivar display_name: The name for the Db Server. + :vartype display_name: str + :ivar compartment_id: The OCID of the compartment. + :vartype compartment_id: str + :ivar exadata_infrastructure_id: The OCID of the Exadata infrastructure. + :vartype exadata_infrastructure_id: str + :ivar cpu_core_count: The number of CPU cores enabled on the Db server. + :vartype cpu_core_count: int + :ivar db_server_patching_details: dbServerPatching details of the Db server. + :vartype db_server_patching_details: ~azure.mgmt.oracledatabase.models.DbServerPatchingDetails + :ivar max_memory_in_gbs: The total memory available in GBs. + :vartype max_memory_in_gbs: int + :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db server. + :vartype db_node_storage_size_in_gbs: int + :ivar vm_cluster_ids: The OCID of the VM Clusters associated with the Db server. + :vartype vm_cluster_ids: list[str] + :ivar db_node_ids: The OCID of the Db nodes associated with the Db server. + :vartype db_node_ids: list[str] + :ivar lifecycle_details: Lifecycle details of dbServer. + :vartype lifecycle_details: str + :ivar lifecycle_state: DbServer provisioning state. Known values are: "Creating", "Available", + "Unavailable", "Deleting", "Deleted", and "MaintenanceInProgress". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbServerProvisioningState + :ivar max_cpu_count: The total number of CPU cores available. + :vartype max_cpu_count: int + :ivar autonomous_vm_cluster_ids: The list of OCIDs of the Autonomous VM Clusters associated + with the Db server. + :vartype autonomous_vm_cluster_ids: list[str] + :ivar autonomous_virtual_machine_ids: The list of OCIDs of the Autonomous Virtual Machines + associated with the Db server. + :vartype autonomous_virtual_machine_ids: list[str] + :ivar max_db_node_storage_in_gbs: The total max dbNode storage in GBs. + :vartype max_db_node_storage_in_gbs: int + :ivar memory_size_in_gbs: The total memory size in GBs. + :vartype memory_size_in_gbs: int + :ivar shape: The shape of the Db server. The shape determines the amount of CPU, storage, and + memory resources available. + :vartype shape: str + :ivar time_created: The date and time that the Db Server was created. + :vartype time_created: ~datetime.datetime + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState + :ivar compute_model: The compute model of the Exadata Infrastructure. Known values are: "ECPU" + and "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + """ + + ocid: Optional[str] = rest_field(visibility=["read"]) + """Db server name.""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """The name for the Db Server.""" + compartment_id: Optional[str] = rest_field(name="compartmentId", visibility=["read"]) + """The OCID of the compartment.""" + exadata_infrastructure_id: Optional[str] = rest_field(name="exadataInfrastructureId", visibility=["read"]) + """The OCID of the Exadata infrastructure.""" + cpu_core_count: Optional[int] = rest_field(name="cpuCoreCount", visibility=["read"]) + """The number of CPU cores enabled on the Db server.""" + db_server_patching_details: Optional["_models.DbServerPatchingDetails"] = rest_field( + name="dbServerPatchingDetails", visibility=["read"] + ) + """dbServerPatching details of the Db server.""" + max_memory_in_gbs: Optional[int] = rest_field(name="maxMemoryInGbs", visibility=["read"]) + """The total memory available in GBs.""" + db_node_storage_size_in_gbs: Optional[int] = rest_field(name="dbNodeStorageSizeInGbs", visibility=["read"]) + """The allocated local node storage in GBs on the Db server.""" + vm_cluster_ids: Optional[List[str]] = rest_field(name="vmClusterIds", visibility=["read"]) + """The OCID of the VM Clusters associated with the Db server.""" + db_node_ids: Optional[List[str]] = rest_field(name="dbNodeIds", visibility=["read"]) + """The OCID of the Db nodes associated with the Db server.""" + lifecycle_details: Optional[str] = rest_field(name="lifecycleDetails", visibility=["read"]) + """Lifecycle details of dbServer.""" + lifecycle_state: Optional[Union[str, "_models.DbServerProvisioningState"]] = rest_field( + name="lifecycleState", visibility=["read"] + ) + """DbServer provisioning state. Known values are: \"Creating\", \"Available\", \"Unavailable\", + \"Deleting\", \"Deleted\", and \"MaintenanceInProgress\".""" + max_cpu_count: Optional[int] = rest_field(name="maxCpuCount", visibility=["read"]) + """The total number of CPU cores available.""" + autonomous_vm_cluster_ids: Optional[List[str]] = rest_field(name="autonomousVmClusterIds", visibility=["read"]) + """The list of OCIDs of the Autonomous VM Clusters associated with the Db server.""" + autonomous_virtual_machine_ids: Optional[List[str]] = rest_field( + name="autonomousVirtualMachineIds", visibility=["read"] + ) + """The list of OCIDs of the Autonomous Virtual Machines associated with the Db server.""" + max_db_node_storage_in_gbs: Optional[int] = rest_field(name="maxDbNodeStorageInGbs", visibility=["read"]) + """The total max dbNode storage in GBs.""" + memory_size_in_gbs: Optional[int] = rest_field(name="memorySizeInGbs", visibility=["read"]) + """The total memory size in GBs.""" + shape: Optional[str] = rest_field(visibility=["read"]) + """The shape of the Db server. The shape determines the amount of CPU, storage, and memory + resources available.""" + time_created: Optional[datetime.datetime] = rest_field(name="timeCreated", visibility=["read"], format="rfc3339") + """The date and time that the Db Server was created.""" + provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Azure resource provisioning state. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + compute_model: Optional[Union[str, "_models.ComputeModel"]] = rest_field(name="computeModel", visibility=["read"]) + """The compute model of the Exadata Infrastructure. Known values are: \"ECPU\" and \"OCPU\".""" + + +class DbSystemShape(ProxyResource): + """DbSystemShape resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.DbSystemShapeProperties + """ + + properties: Optional["_models.DbSystemShapeProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.DbSystemShapeProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DbSystemShapeProperties(_Model): + """DbSystemShape resource model. + + :ivar shape_family: The family of the shape used for the DB system. + :vartype shape_family: str + :ivar shape_name: The shape used for the DB system. Required. + :vartype shape_name: str + :ivar available_core_count: The maximum number of CPU cores that can be enabled on the DB + system for this shape. Required. + :vartype available_core_count: int + :ivar minimum_core_count: The minimum number of CPU cores that can be enabled on the DB system + for this shape. + :vartype minimum_core_count: int + :ivar runtime_minimum_core_count: The runtime minimum number of CPU cores that can be enabled + on the DB system for this shape. + :vartype runtime_minimum_core_count: int + :ivar core_count_increment: The discrete number by which the CPU core count for this shape can + be increased or decreased. + :vartype core_count_increment: int + :ivar min_storage_count: The minimum number of Exadata storage servers available for the + Exadata infrastructure. + :vartype min_storage_count: int + :ivar max_storage_count: The maximum number of Exadata storage servers available for the + Exadata infrastructure. + :vartype max_storage_count: int + :ivar available_data_storage_per_server_in_tbs: The maximum data storage available per storage + server for this shape. Only applicable to ExaCC Elastic shapes. + :vartype available_data_storage_per_server_in_tbs: float + :ivar available_memory_per_node_in_gbs: The maximum memory available per database node for this + shape. Only applicable to ExaCC Elastic shapes. + :vartype available_memory_per_node_in_gbs: int + :ivar available_db_node_per_node_in_gbs: The maximum Db Node storage available per database + node for this shape. Only applicable to ExaCC Elastic shapes. + :vartype available_db_node_per_node_in_gbs: int + :ivar min_core_count_per_node: The minimum number of CPU cores that can be enabled per node for + this shape. + :vartype min_core_count_per_node: int + :ivar available_memory_in_gbs: The maximum memory that can be enabled for this shape. + :vartype available_memory_in_gbs: int + :ivar min_memory_per_node_in_gbs: The minimum memory that need be allocated per node for this + shape. + :vartype min_memory_per_node_in_gbs: int + :ivar available_db_node_storage_in_gbs: The maximum Db Node storage that can be enabled for + this shape. + :vartype available_db_node_storage_in_gbs: int + :ivar min_db_node_storage_per_node_in_gbs: The minimum Db Node storage that need be allocated + per node for this shape. + :vartype min_db_node_storage_per_node_in_gbs: int + :ivar available_data_storage_in_tbs: The maximum DATA storage that can be enabled for this + shape. + :vartype available_data_storage_in_tbs: int + :ivar min_data_storage_in_tbs: The minimum data storage that need be allocated for this shape. + :vartype min_data_storage_in_tbs: int + :ivar minimum_node_count: The minimum number of database nodes available for this shape. + :vartype minimum_node_count: int + :ivar maximum_node_count: The maximum number of database nodes available for this shape. + :vartype maximum_node_count: int + :ivar available_core_count_per_node: The maximum number of CPU cores per database node that can + be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. + :vartype available_core_count_per_node: int + :ivar compute_model: The compute model of the Exadata Infrastructure. Known values are: "ECPU" + and "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :ivar are_server_types_supported: Indicates if the shape supports database and storage server + types. + :vartype are_server_types_supported: bool + :ivar display_name: The display name of the shape used for the DB system. + :vartype display_name: str + """ + + shape_family: Optional[str] = rest_field( + name="shapeFamily", visibility=["read", "create", "update", "delete", "query"] + ) + """The family of the shape used for the DB system.""" + shape_name: str = rest_field(name="shapeName", visibility=["read", "create", "update", "delete", "query"]) + """The shape used for the DB system. Required.""" + available_core_count: int = rest_field( + name="availableCoreCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of CPU cores that can be enabled on the DB system for this shape. Required.""" + minimum_core_count: Optional[int] = rest_field( + name="minimumCoreCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The minimum number of CPU cores that can be enabled on the DB system for this shape.""" + runtime_minimum_core_count: Optional[int] = rest_field( + name="runtimeMinimumCoreCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The runtime minimum number of CPU cores that can be enabled on the DB system for this shape.""" + core_count_increment: Optional[int] = rest_field( + name="coreCountIncrement", visibility=["read", "create", "update", "delete", "query"] + ) + """The discrete number by which the CPU core count for this shape can be increased or decreased.""" + min_storage_count: Optional[int] = rest_field( + name="minStorageCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The minimum number of Exadata storage servers available for the Exadata infrastructure.""" + max_storage_count: Optional[int] = rest_field( + name="maxStorageCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of Exadata storage servers available for the Exadata infrastructure.""" + available_data_storage_per_server_in_tbs: Optional[float] = rest_field( + name="availableDataStoragePerServerInTbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum data storage available per storage server for this shape. Only applicable to ExaCC + Elastic shapes.""" + available_memory_per_node_in_gbs: Optional[int] = rest_field( + name="availableMemoryPerNodeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum memory available per database node for this shape. Only applicable to ExaCC Elastic + shapes.""" + available_db_node_per_node_in_gbs: Optional[int] = rest_field( + name="availableDbNodePerNodeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum Db Node storage available per database node for this shape. Only applicable to + ExaCC Elastic shapes.""" + min_core_count_per_node: Optional[int] = rest_field( + name="minCoreCountPerNode", visibility=["read", "create", "update", "delete", "query"] + ) + """The minimum number of CPU cores that can be enabled per node for this shape.""" + available_memory_in_gbs: Optional[int] = rest_field( + name="availableMemoryInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum memory that can be enabled for this shape.""" + min_memory_per_node_in_gbs: Optional[int] = rest_field( + name="minMemoryPerNodeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The minimum memory that need be allocated per node for this shape.""" + available_db_node_storage_in_gbs: Optional[int] = rest_field( + name="availableDbNodeStorageInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum Db Node storage that can be enabled for this shape.""" + min_db_node_storage_per_node_in_gbs: Optional[int] = rest_field( + name="minDbNodeStoragePerNodeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The minimum Db Node storage that need be allocated per node for this shape.""" + available_data_storage_in_tbs: Optional[int] = rest_field( + name="availableDataStorageInTbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum DATA storage that can be enabled for this shape.""" + min_data_storage_in_tbs: Optional[int] = rest_field( + name="minDataStorageInTbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The minimum data storage that need be allocated for this shape.""" + minimum_node_count: Optional[int] = rest_field( + name="minimumNodeCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The minimum number of database nodes available for this shape.""" + maximum_node_count: Optional[int] = rest_field( + name="maximumNodeCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of database nodes available for this shape.""" + available_core_count_per_node: Optional[int] = rest_field( + name="availableCoreCountPerNode", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of CPU cores per database node that can be enabled for this shape. Only + applicable to the flex Exadata shape and ExaCC Elastic shapes.""" + compute_model: Optional[Union[str, "_models.ComputeModel"]] = rest_field( + name="computeModel", visibility=["read", "create", "update", "delete", "query"] + ) + """The compute model of the Exadata Infrastructure. Known values are: \"ECPU\" and \"OCPU\".""" + are_server_types_supported: Optional[bool] = rest_field( + name="areServerTypesSupported", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates if the shape supports database and storage server types.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """The display name of the shape used for the DB system.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + shape_name: str, + available_core_count: int, + shape_family: Optional[str] = None, + minimum_core_count: Optional[int] = None, + runtime_minimum_core_count: Optional[int] = None, + core_count_increment: Optional[int] = None, + min_storage_count: Optional[int] = None, + max_storage_count: Optional[int] = None, + available_data_storage_per_server_in_tbs: Optional[float] = None, + available_memory_per_node_in_gbs: Optional[int] = None, + available_db_node_per_node_in_gbs: Optional[int] = None, + min_core_count_per_node: Optional[int] = None, + available_memory_in_gbs: Optional[int] = None, + min_memory_per_node_in_gbs: Optional[int] = None, + available_db_node_storage_in_gbs: Optional[int] = None, + min_db_node_storage_per_node_in_gbs: Optional[int] = None, + available_data_storage_in_tbs: Optional[int] = None, + min_data_storage_in_tbs: Optional[int] = None, + minimum_node_count: Optional[int] = None, + maximum_node_count: Optional[int] = None, + available_core_count_per_node: Optional[int] = None, + compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, + are_server_types_supported: Optional[bool] = None, + display_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DefinedFileSystemConfiguration(_Model): + """Predefined configurations for the file system. + + :ivar is_backup_partition: Checks if the data can be backed up. + :vartype is_backup_partition: bool + :ivar is_resizable: Checks if the mount path is resizable. + :vartype is_resizable: bool + :ivar min_size_gb: Minimum size of mount path in Gb. + :vartype min_size_gb: int + :ivar mount_point: Mount path for the file system. + :vartype mount_point: str + """ + + is_backup_partition: Optional[bool] = rest_field( + name="isBackupPartition", visibility=["read", "create", "update", "delete", "query"] + ) + """Checks if the data can be backed up.""" + is_resizable: Optional[bool] = rest_field( + name="isResizable", visibility=["read", "create", "update", "delete", "query"] + ) + """Checks if the mount path is resizable.""" + min_size_gb: Optional[int] = rest_field( + name="minSizeGb", visibility=["read", "create", "update", "delete", "query"] + ) + """Minimum size of mount path in Gb.""" + mount_point: Optional[str] = rest_field( + name="mountPoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Mount path for the file system.""" + + @overload + def __init__( + self, + *, + is_backup_partition: Optional[bool] = None, + is_resizable: Optional[bool] = None, + min_size_gb: Optional[int] = None, + mount_point: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DisasterRecoveryConfigurationDetails(_Model): + """Configurations of a Disaster Recovery Details. + + :ivar disaster_recovery_type: Indicates the disaster recovery (DR) type of the Autonomous + Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR + with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type + provides lower cost DR with a slower RTO during failover or switchover. Known values are: "Adg" + and "BackupBased". + :vartype disaster_recovery_type: str or ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_snapshot_standby_enabled_till: Time and date stored as an RFC 3339 formatted + timestamp string. For example, 2022-01-01T12:00:00.000Z would set a limit for the snapshot + standby to be converted back to a cross-region standby database. + :vartype time_snapshot_standby_enabled_till: ~datetime.datetime + :ivar is_snapshot_standby: Indicates if user wants to convert to a snapshot standby. For + example, true would set a standby database to snapshot standby database. False would set a + snapshot standby database back to regular standby database. + :vartype is_snapshot_standby: bool + :ivar is_replicate_automatic_backups: If true, 7 days worth of backups are replicated across + regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the + backups taken on the Primary are not replicated to the Standby database. + :vartype is_replicate_automatic_backups: bool + """ + + disaster_recovery_type: Optional[Union[str, "_models.DisasterRecoveryType"]] = rest_field( + name="disasterRecoveryType", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates the disaster recovery (DR) type of the Autonomous Database Serverless instance. + Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time + objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with + a slower RTO during failover or switchover. Known values are: \"Adg\" and \"BackupBased\".""" + time_snapshot_standby_enabled_till: Optional[datetime.datetime] = rest_field( + name="timeSnapshotStandbyEnabledTill", + visibility=["read", "create", "update", "delete", "query"], + format="rfc3339", + ) + """Time and date stored as an RFC 3339 formatted timestamp string. For example, + 2022-01-01T12:00:00.000Z would set a limit for the snapshot standby to be converted back to a + cross-region standby database.""" + is_snapshot_standby: Optional[bool] = rest_field( + name="isSnapshotStandby", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates if user wants to convert to a snapshot standby. For example, true would set a standby + database to snapshot standby database. False would set a snapshot standby database back to + regular standby database.""" + is_replicate_automatic_backups: Optional[bool] = rest_field( + name="isReplicateAutomaticBackups", visibility=["read", "create", "update", "delete", "query"] + ) + """If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or + Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not + replicated to the Standby database.""" + + @overload + def __init__( + self, + *, + disaster_recovery_type: Optional[Union[str, "_models.DisasterRecoveryType"]] = None, + time_snapshot_standby_enabled_till: Optional[datetime.datetime] = None, + is_snapshot_standby: Optional[bool] = None, + is_replicate_automatic_backups: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DnsPrivateView(ProxyResource): + """DnsPrivateView resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateViewProperties + """ + + properties: Optional["_models.DnsPrivateViewProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.DnsPrivateViewProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DnsPrivateViewProperties(_Model): + """Views resource model. + + :ivar ocid: The OCID of the view. Required. + :vartype ocid: str + :ivar display_name: The display name of the view resource. Required. + :vartype display_name: str + :ivar is_protected: A Boolean flag indicating whether or not parts of the resource are unable + to be explicitly managed. Required. + :vartype is_protected: bool + :ivar lifecycle_state: Views lifecycleState. Required. Known values are: "Active", "Deleted", + "Deleting", and "Updating". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.DnsPrivateViewsLifecycleState + :ivar self_property: The canonical absolute URL of the resource. Required. + :vartype self_property: str + :ivar time_created: views timeCreated. Required. + :vartype time_created: ~datetime.datetime + :ivar time_updated: views timeCreated. Required. + :vartype time_updated: ~datetime.datetime + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState + """ + + ocid: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The OCID of the view. Required.""" + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) + """The display name of the view resource. Required.""" + is_protected: bool = rest_field(name="isProtected", visibility=["read", "create", "update", "delete", "query"]) + """A Boolean flag indicating whether or not parts of the resource are unable to be explicitly + managed. Required.""" + lifecycle_state: Union[str, "_models.DnsPrivateViewsLifecycleState"] = rest_field( + name="lifecycleState", visibility=["read", "create", "update", "delete", "query"] + ) + """Views lifecycleState. Required. Known values are: \"Active\", \"Deleted\", \"Deleting\", and + \"Updating\".""" + self_property: str = rest_field(name="self", visibility=["read", "create", "update", "delete", "query"]) + """The canonical absolute URL of the resource. Required.""" + time_created: datetime.datetime = rest_field( + name="timeCreated", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """views timeCreated. Required.""" + time_updated: datetime.datetime = rest_field( + name="timeUpdated", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """views timeCreated. Required.""" + provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Azure resource provisioning state. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + @overload + def __init__( + self, + *, + ocid: str, + display_name: str, + is_protected: bool, + lifecycle_state: Union[str, "_models.DnsPrivateViewsLifecycleState"], + self_property: str, + time_created: datetime.datetime, + time_updated: datetime.datetime, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DnsPrivateZone(ProxyResource): + """DnsPrivateZone resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateZoneProperties + """ + + properties: Optional["_models.DnsPrivateZoneProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.DnsPrivateZoneProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DnsPrivateZoneProperties(_Model): + """Zones resource model. + + :ivar ocid: The OCID of the Zone. Required. + :vartype ocid: str + :ivar is_protected: A Boolean flag indicating whether or not parts of the resource are unable + to be explicitly managed. Required. + :vartype is_protected: bool + :ivar lifecycle_state: Zones lifecycleState. Required. Known values are: "Active", "Creating", + "Deleted", "Deleting", and "Updating". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.DnsPrivateZonesLifecycleState + :ivar self_property: The canonical absolute URL of the resource. Required. + :vartype self_property: str + :ivar serial: The current serial of the zone. As seen in the zone's SOA record. Required. + :vartype serial: int + :ivar version: Version is the never-repeating, totally-orderable, version of the zone, from + which the serial field of the zone's SOA record is derived. Required. + :vartype version: str + :ivar view_id: The OCID of the private view containing the zone. This value will be null for + zones in the global DNS, which are publicly resolvable and not part of a private view. + :vartype view_id: str + :ivar zone_type: The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only + supported for GLOBAL zones. Required. Known values are: "Primary" and "Secondary". + :vartype zone_type: str or ~azure.mgmt.oracledatabase.models.ZoneType + :ivar time_created: Zones timeCreated. Required. + :vartype time_created: ~datetime.datetime + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState + """ + + ocid: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The OCID of the Zone. Required.""" + is_protected: bool = rest_field(name="isProtected", visibility=["read", "create", "update", "delete", "query"]) + """A Boolean flag indicating whether or not parts of the resource are unable to be explicitly + managed. Required.""" + lifecycle_state: Union[str, "_models.DnsPrivateZonesLifecycleState"] = rest_field( + name="lifecycleState", visibility=["read", "create", "update", "delete", "query"] + ) + """Zones lifecycleState. Required. Known values are: \"Active\", \"Creating\", \"Deleted\", + \"Deleting\", and \"Updating\".""" + self_property: str = rest_field(name="self", visibility=["read", "create", "update", "delete", "query"]) + """The canonical absolute URL of the resource. Required.""" + serial: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The current serial of the zone. As seen in the zone's SOA record. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version is the never-repeating, totally-orderable, version of the zone, from which the serial + field of the zone's SOA record is derived. Required.""" + view_id: Optional[str] = rest_field(name="viewId", visibility=["read", "create", "update", "delete", "query"]) + """The OCID of the private view containing the zone. This value will be null for zones in the + global DNS, which are publicly resolvable and not part of a private view.""" + zone_type: Union[str, "_models.ZoneType"] = rest_field( + name="zoneType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for + GLOBAL zones. Required. Known values are: \"Primary\" and \"Secondary\".""" + time_created: datetime.datetime = rest_field( + name="timeCreated", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Zones timeCreated. Required.""" + provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Azure resource provisioning state. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + + @overload + def __init__( + self, + *, + ocid: str, + is_protected: bool, + lifecycle_state: Union[str, "_models.DnsPrivateZonesLifecycleState"], + self_property: str, + serial: int, + version: str, + zone_type: Union[str, "_models.ZoneType"], + time_created: datetime.datetime, + view_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.oracledatabase.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.oracledatabase.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.oracledatabase.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EstimatedPatchingTime(_Model): + """The estimated total time required in minutes for all patching operations (database server, + storage server, and network switch patching). + + :ivar estimated_db_server_patching_time: The estimated time required in minutes for database + server patching. + :vartype estimated_db_server_patching_time: int + :ivar estimated_network_switches_patching_time: The estimated time required in minutes for + network switch patching. + :vartype estimated_network_switches_patching_time: int + :ivar estimated_storage_server_patching_time: The estimated time required in minutes for + storage server patching. + :vartype estimated_storage_server_patching_time: int + :ivar total_estimated_patching_time: The estimated total time required in minutes for all + patching operations. + :vartype total_estimated_patching_time: int + """ + + estimated_db_server_patching_time: Optional[int] = rest_field( + name="estimatedDbServerPatchingTime", visibility=["read"] + ) + """The estimated time required in minutes for database server patching.""" + estimated_network_switches_patching_time: Optional[int] = rest_field( + name="estimatedNetworkSwitchesPatchingTime", visibility=["read"] + ) + """The estimated time required in minutes for network switch patching.""" + estimated_storage_server_patching_time: Optional[int] = rest_field( + name="estimatedStorageServerPatchingTime", visibility=["read"] + ) + """The estimated time required in minutes for storage server patching.""" + total_estimated_patching_time: Optional[int] = rest_field(name="totalEstimatedPatchingTime", visibility=["read"]) + """The estimated total time required in minutes for all patching operations.""" + + +class ExadataIormConfig(_Model): + """ExadataIormConfig for cloud vm cluster. + + :ivar db_plans: An array of IORM settings for all the database in the Exadata DB system. + :vartype db_plans: list[~azure.mgmt.oracledatabase.models.DbIormConfig] + :ivar lifecycle_details: Additional information about the current lifecycleState. + :vartype lifecycle_details: str + :ivar lifecycle_state: The current state of IORM configuration for the Exadata DB system. Known + values are: "BootStrapping", "Enabled", "Disabled", "Updating", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.IormLifecycleState + :ivar objective: The current value for the IORM objective. The default is AUTO. Known values + are: "LowLatency", "HighThroughput", "Balanced", "Auto", and "Basic". + :vartype objective: str or ~azure.mgmt.oracledatabase.models.Objective + """ + + db_plans: Optional[List["_models.DbIormConfig"]] = rest_field( + name="dbPlans", visibility=["read", "create", "update", "delete", "query"] + ) + """An array of IORM settings for all the database in the Exadata DB system.""" + lifecycle_details: Optional[str] = rest_field( + name="lifecycleDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional information about the current lifecycleState.""" + lifecycle_state: Optional[Union[str, "_models.IormLifecycleState"]] = rest_field( + name="lifecycleState", visibility=["read", "create", "update", "delete", "query"] + ) + """The current state of IORM configuration for the Exadata DB system. Known values are: + \"BootStrapping\", \"Enabled\", \"Disabled\", \"Updating\", and \"Failed\".""" + objective: Optional[Union[str, "_models.Objective"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The current value for the IORM objective. The default is AUTO. Known values are: + \"LowLatency\", \"HighThroughput\", \"Balanced\", \"Auto\", and \"Basic\".""" + + @overload + def __init__( + self, + *, + db_plans: Optional[List["_models.DbIormConfig"]] = None, + lifecycle_details: Optional[str] = None, + lifecycle_state: Optional[Union[str, "_models.IormLifecycleState"]] = None, + objective: Optional[Union[str, "_models.Objective"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExadbVmCluster(TrackedResource): + """ExadbVmCluster resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterProperties + :ivar zones: The availability zones. + :vartype zones: list[str] + """ + + properties: Optional["_models.ExadbVmClusterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + zones: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The availability zones.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ExadbVmClusterProperties"] = None, + zones: Optional[List[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExadbVmClusterProperties(_Model): + """ExadbVmCluster resource model. + + :ivar ocid: ExadbVmCluster ocid. + :vartype ocid: str + :ivar cluster_name: The cluster name for Exadata VM cluster on Exascale Infrastructure. The + cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores + (_) are not permitted. The cluster name can be no longer than 11 characters and is not case + sensitive. + :vartype cluster_name: str + :ivar backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. + :vartype backup_subnet_cidr: str + :ivar nsg_url: HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure + Interface. + :vartype nsg_url: str + :ivar provisioning_state: Exadata VM cluster on Exascale Infrastructure provisioning state. + Known values are: "Succeeded", "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: CloudVmCluster lifecycle state. Known values are: "Provisioning", + "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.ExadbVmClusterLifecycleState + :ivar vnet_id: VNET for network connectivity. Required. + :vartype vnet_id: str + :ivar subnet_id: Client subnet. Required. + :vartype subnet_id: str + :ivar data_collection_options: Indicates user preferences for the various diagnostic collection + options for the VM cluster/Cloud VM cluster/VMBM DBCS. + :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions + :ivar display_name: Display Name. Required. + :vartype display_name: str + :ivar domain: A domain name used for the Exadata VM cluster on Exascale Infrastructure. + :vartype domain: str + :ivar enabled_ecpu_count: The number of ECPUs to enable for an Exadata VM cluster on Exascale + Infrastructure. Required. + :vartype enabled_ecpu_count: int + :ivar exascale_db_storage_vault_id: The Azure Resource ID of the Exadata Database Storage + Vault. Required. + :vartype exascale_db_storage_vault_id: str + :ivar grid_image_ocid: Grid Setup will be done using this Grid Image OCID. Can be obtained + using giMinorVersions API. + :vartype grid_image_ocid: str + :ivar grid_image_type: The type of Grid Image. Known values are: "ReleaseUpdate" and + "CustomImage". + :vartype grid_image_type: str or ~azure.mgmt.oracledatabase.models.GridImageType + :ivar gi_version: Oracle Grid Infrastructure (GI) software version. + :vartype gi_version: str + :ivar hostname: The hostname for the Exadata VM cluster on Exascale Infrastructure. Required. + :vartype hostname: str + :ivar license_model: The Oracle license model that applies to the Exadata VM cluster on + Exascale Infrastructure. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" + and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar memory_size_in_gbs: The memory that you want to be allocated in GBs. Memory is calculated + based on 11 GB per VM core reserved. + :vartype memory_size_in_gbs: int + :ivar node_count: The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + Required. + :vartype node_count: int + :ivar nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision + the VM Cluster will be added by default. + :vartype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] + :ivar zone_ocid: The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is + associated with. + :vartype zone_ocid: str + :ivar private_zone_ocid: The OCID of the zone the Exadata VM cluster on Exascale Infrastructure + is associated with. + :vartype private_zone_ocid: str + :ivar scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default port + is 1521. + :vartype scan_listener_port_tcp: int + :ivar scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The default + port is 2484. + :vartype scan_listener_port_tcp_ssl: int + :ivar listener_port: The port number configured for the listener on the Exadata VM cluster on + Exascale Infrastructure. + :vartype listener_port: int + :ivar shape: The shape of the Exadata VM cluster on Exascale Infrastructure resource. Required. + :vartype shape: str + :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to + the Exadata VM cluster on Exascale Infrastructure. Required. + :vartype ssh_public_keys: list[str] + :ivar system_version: Operating system version of the image. + :vartype system_version: str + :ivar time_zone: The time zone of the Exadata VM cluster on Exascale Infrastructure. For + details, see `Exadata Infrastructure Time Zones `_. + :vartype time_zone: str + :ivar total_ecpu_count: The number of Total ECPUs for an Exadata VM cluster on Exascale + Infrastructure. Required. + :vartype total_ecpu_count: int + :ivar vm_file_system_storage: Filesystem storage details. Required. + :vartype vm_file_system_storage: ~azure.mgmt.oracledatabase.models.ExadbVmClusterStorageDetails + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar scan_dns_name: The FQDN of the DNS record for the SCAN IP addresses that are associated + with the Exadata VM cluster on Exascale Infrastructure. + :vartype scan_dns_name: str + :ivar scan_ip_ids: The Single Client Access Name (SCAN) IP addresses associated with the + Exadata VM cluster on Exascale Infrastructure. SCAN IP addresses are typically used for load + balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the + appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + :vartype scan_ip_ids: list[str] + :ivar scan_dns_record_id: The OCID of the DNS record for the SCAN IP addresses that are + associated with the Exadata VM cluster on Exascale Infrastructure. + :vartype scan_dns_record_id: str + :ivar snapshot_file_system_storage: Snapshot filesystem storage details. + :vartype snapshot_file_system_storage: + ~azure.mgmt.oracledatabase.models.ExadbVmClusterStorageDetails + :ivar total_file_system_storage: Total file system storage details. + :vartype total_file_system_storage: + ~azure.mgmt.oracledatabase.models.ExadbVmClusterStorageDetails + :ivar vip_ids: The virtual IP (VIP) addresses associated with the Exadata VM cluster on + Exascale Infrastructure. The Cluster Ready Services (CRS) creates and maintains one VIP address + for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the + VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, + this list is empty. + :vartype vip_ids: list[str] + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar iorm_config_cache: iormConfigCache details for Exadata VM cluster on Exascale + Infrastructure. + :vartype iorm_config_cache: ~azure.mgmt.oracledatabase.models.ExadataIormConfig + :ivar backup_subnet_ocid: Cluster backup subnet ocid. + :vartype backup_subnet_ocid: str + :ivar subnet_ocid: Cluster subnet ocid. + :vartype subnet_ocid: str + """ + + ocid: Optional[str] = rest_field(visibility=["read"]) + """ExadbVmCluster ocid.""" + cluster_name: Optional[str] = rest_field(name="clusterName", visibility=["read", "create"]) + """The cluster name for Exadata VM cluster on Exascale Infrastructure. The cluster name must begin + with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. + The cluster name can be no longer than 11 characters and is not case sensitive.""" + backup_subnet_cidr: Optional[str] = rest_field(name="backupSubnetCidr", visibility=["read", "create"]) + """Client OCI backup subnet CIDR, default is 192.168.252.0/22.""" + nsg_url: Optional[str] = rest_field(name="nsgUrl", visibility=["read"]) + """HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface.""" + provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Exadata VM cluster on Exascale Infrastructure provisioning state. Known values are: + \"Succeeded\", \"Failed\", \"Canceled\", and \"Provisioning\".""" + lifecycle_state: Optional[Union[str, "_models.ExadbVmClusterLifecycleState"]] = rest_field( + name="lifecycleState", visibility=["read"] + ) + """CloudVmCluster lifecycle state. Known values are: \"Provisioning\", \"Available\", + \"Updating\", \"Terminating\", \"Terminated\", \"MaintenanceInProgress\", and \"Failed\".""" + vnet_id: str = rest_field(name="vnetId", visibility=["read", "create"]) + """VNET for network connectivity. Required.""" + subnet_id: str = rest_field(name="subnetId", visibility=["read", "create"]) + """Client subnet. Required.""" + data_collection_options: Optional["_models.DataCollectionOptions"] = rest_field( + name="dataCollectionOptions", visibility=["read", "create"] + ) + """Indicates user preferences for the various diagnostic collection options for the VM + cluster/Cloud VM cluster/VMBM DBCS.""" + display_name: str = rest_field(name="displayName", visibility=["read", "create"]) + """Display Name. Required.""" + domain: Optional[str] = rest_field(visibility=["read", "create"]) + """A domain name used for the Exadata VM cluster on Exascale Infrastructure.""" + enabled_ecpu_count: int = rest_field(name="enabledEcpuCount", visibility=["read", "create"]) + """The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. Required.""" + exascale_db_storage_vault_id: str = rest_field(name="exascaleDbStorageVaultId", visibility=["read", "create"]) + """The Azure Resource ID of the Exadata Database Storage Vault. Required.""" + grid_image_ocid: Optional[str] = rest_field(name="gridImageOcid", visibility=["read", "create"]) + """Grid Setup will be done using this Grid Image OCID. Can be obtained using giMinorVersions API.""" + grid_image_type: Optional[Union[str, "_models.GridImageType"]] = rest_field( + name="gridImageType", visibility=["read"] + ) + """The type of Grid Image. Known values are: \"ReleaseUpdate\" and \"CustomImage\".""" + gi_version: Optional[str] = rest_field(name="giVersion", visibility=["read"]) + """Oracle Grid Infrastructure (GI) software version.""" + hostname: str = rest_field(visibility=["read", "create"]) + """The hostname for the Exadata VM cluster on Exascale Infrastructure. Required.""" + license_model: Optional[Union[str, "_models.LicenseModel"]] = rest_field( + name="licenseModel", visibility=["read", "create"] + ) + """The Oracle license model that applies to the Exadata VM cluster on Exascale Infrastructure. The + default is LICENSE_INCLUDED. Known values are: \"LicenseIncluded\" and \"BringYourOwnLicense\".""" + memory_size_in_gbs: Optional[int] = rest_field(name="memorySizeInGbs", visibility=["read"]) + """The memory that you want to be allocated in GBs. Memory is calculated based on 11 GB per VM + core reserved.""" + node_count: int = rest_field(name="nodeCount", visibility=["read", "create", "update"]) + """The number of nodes in the Exadata VM cluster on Exascale Infrastructure. Required.""" + nsg_cidrs: Optional[List["_models.NsgCidr"]] = rest_field(name="nsgCidrs", visibility=["read", "create"]) + """CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster + will be added by default.""" + zone_ocid: Optional[str] = rest_field(name="zoneOcid", visibility=["read"]) + """The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with.""" + private_zone_ocid: Optional[str] = rest_field(name="privateZoneOcid", visibility=["read", "create"]) + """The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with.""" + scan_listener_port_tcp: Optional[int] = rest_field(name="scanListenerPortTcp", visibility=["read", "create"]) + """The TCP Single Client Access Name (SCAN) port. The default port is 1521.""" + scan_listener_port_tcp_ssl: Optional[int] = rest_field(name="scanListenerPortTcpSsl", visibility=["read", "create"]) + """The TCPS Single Client Access Name (SCAN) port. The default port is 2484.""" + listener_port: Optional[int] = rest_field(name="listenerPort", visibility=["read"]) + """The port number configured for the listener on the Exadata VM cluster on Exascale + Infrastructure.""" + shape: str = rest_field(visibility=["read", "create"]) + """The shape of the Exadata VM cluster on Exascale Infrastructure resource. Required.""" + ssh_public_keys: List[str] = rest_field(name="sshPublicKeys", visibility=["read", "create"]) + """The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster + on Exascale Infrastructure. Required.""" + system_version: Optional[str] = rest_field(name="systemVersion", visibility=["read", "create"]) + """Operating system version of the image.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create"]) + """The time zone of the Exadata VM cluster on Exascale Infrastructure. For details, see `Exadata + Infrastructure Time Zones `_.""" + total_ecpu_count: int = rest_field(name="totalEcpuCount", visibility=["read", "create"]) + """The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. Required.""" + vm_file_system_storage: "_models.ExadbVmClusterStorageDetails" = rest_field( + name="vmFileSystemStorage", visibility=["read", "create"] + ) + """Filesystem storage details. Required.""" + lifecycle_details: Optional[str] = rest_field(name="lifecycleDetails", visibility=["read"]) + """Additional information about the current lifecycle state.""" + scan_dns_name: Optional[str] = rest_field(name="scanDnsName", visibility=["read"]) + """The FQDN of the DNS record for the SCAN IP addresses that are associated with the Exadata VM + cluster on Exascale Infrastructure.""" + scan_ip_ids: Optional[List[str]] = rest_field(name="scanIpIds", visibility=["read"]) + """The Single Client Access Name (SCAN) IP addresses associated with the Exadata VM cluster on + Exascale Infrastructure. SCAN IP addresses are typically used for load balancing and are not + assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in + the cluster. **Note:** For a single-node DB system, this list is empty.""" + scan_dns_record_id: Optional[str] = rest_field(name="scanDnsRecordId", visibility=["read"]) + """The OCID of the DNS record for the SCAN IP addresses that are associated with the Exadata VM + cluster on Exascale Infrastructure.""" + snapshot_file_system_storage: Optional["_models.ExadbVmClusterStorageDetails"] = rest_field( + name="snapshotFileSystemStorage", visibility=["read"] + ) + """Snapshot filesystem storage details.""" + total_file_system_storage: Optional["_models.ExadbVmClusterStorageDetails"] = rest_field( + name="totalFileSystemStorage", visibility=["read"] + ) + """Total file system storage details.""" + vip_ids: Optional[List[str]] = rest_field(name="vipIds", visibility=["read"]) + """The virtual IP (VIP) addresses associated with the Exadata VM cluster on Exascale + Infrastructure. The Cluster Ready Services (CRS) creates and maintains one VIP address for each + node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is + reassigned to another active node in the cluster. **Note:** For a single-node DB system, this + list is empty.""" + oci_url: Optional[str] = rest_field(name="ociUrl", visibility=["read"]) + """HTTPS link to OCI resources exposed to Azure Customer via Azure Interface.""" + iorm_config_cache: Optional["_models.ExadataIormConfig"] = rest_field(name="iormConfigCache", visibility=["read"]) + """iormConfigCache details for Exadata VM cluster on Exascale Infrastructure.""" + backup_subnet_ocid: Optional[str] = rest_field(name="backupSubnetOcid", visibility=["read"]) + """Cluster backup subnet ocid.""" + subnet_ocid: Optional[str] = rest_field(name="subnetOcid", visibility=["read"]) + """Cluster subnet ocid.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + vnet_id: str, + subnet_id: str, + display_name: str, + enabled_ecpu_count: int, + exascale_db_storage_vault_id: str, + hostname: str, + node_count: int, + shape: str, + ssh_public_keys: List[str], + total_ecpu_count: int, + vm_file_system_storage: "_models.ExadbVmClusterStorageDetails", + cluster_name: Optional[str] = None, + backup_subnet_cidr: Optional[str] = None, + data_collection_options: Optional["_models.DataCollectionOptions"] = None, + domain: Optional[str] = None, + grid_image_ocid: Optional[str] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + nsg_cidrs: Optional[List["_models.NsgCidr"]] = None, + private_zone_ocid: Optional[str] = None, + scan_listener_port_tcp: Optional[int] = None, + scan_listener_port_tcp_ssl: Optional[int] = None, + system_version: Optional[str] = None, + time_zone: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExadbVmClusterStorageDetails(_Model): + """Storage Details on the Exadata VM cluster. + + :ivar total_size_in_gbs: Total Capacity. Required. + :vartype total_size_in_gbs: int + """ + + total_size_in_gbs: int = rest_field( + name="totalSizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """Total Capacity. Required.""" + + @overload + def __init__( + self, + *, + total_size_in_gbs: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExadbVmClusterUpdate(_Model): + """The type used for update operations of the ExadbVmCluster. + + :ivar zones: The availability zones. + :vartype zones: list[str] + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdateProperties + """ + + zones: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The availability zones.""" + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.ExadbVmClusterUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + zones: Optional[List[str]] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ExadbVmClusterUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExadbVmClusterUpdateProperties(_Model): + """The updatable properties of the ExadbVmCluster. + + :ivar node_count: The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + :vartype node_count: int + """ + + node_count: Optional[int] = rest_field(name="nodeCount", visibility=["read", "create", "update"]) + """The number of nodes in the Exadata VM cluster on Exascale Infrastructure.""" + + @overload + def __init__( + self, + *, + node_count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExascaleDbNode(ProxyResource): + """The DbNode resource belonging to ExadbVmCluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.ExascaleDbNodeProperties + """ + + properties: Optional["_models.ExascaleDbNodeProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.ExascaleDbNodeProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExascaleDbNodeProperties(_Model): + """The properties of DbNodeResource. + + :ivar ocid: DbNode OCID. Required. + :vartype ocid: str + :ivar additional_details: Additional information about the planned maintenance. + :vartype additional_details: str + :ivar cpu_core_count: The number of CPU cores enabled on the Db node. + :vartype cpu_core_count: int + :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db node. + :vartype db_node_storage_size_in_gbs: int + :ivar fault_domain: The name of the Fault Domain the instance is contained in. + :vartype fault_domain: str + :ivar hostname: The host name for the database node. + :vartype hostname: str + :ivar lifecycle_state: The current state of the database node. Known values are: + "Provisioning", "Available", "Updating", "Stopping", "Stopped", "Starting", "Terminating", + "Terminated", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbNodeProvisioningState + :ivar maintenance_type: The type of database node maintenance. + :vartype maintenance_type: str + :ivar memory_size_in_gbs: The allocated memory in GBs on the Db node. + :vartype memory_size_in_gbs: int + :ivar software_storage_size_in_gb: The size (in GB) of the block storage volume allocation for + the DB system. This attribute applies only for virtual machine DB systems. + :vartype software_storage_size_in_gb: int + :ivar time_maintenance_window_end: End date and time of maintenance window. + :vartype time_maintenance_window_end: ~datetime.datetime + :ivar time_maintenance_window_start: Start date and time of maintenance window. + :vartype time_maintenance_window_start: ~datetime.datetime + :ivar total_cpu_core_count: The total number of CPU cores reserved on the Db node. + :vartype total_cpu_core_count: int + """ + + ocid: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """DbNode OCID. Required.""" + additional_details: Optional[str] = rest_field( + name="additionalDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional information about the planned maintenance.""" + cpu_core_count: Optional[int] = rest_field( + name="cpuCoreCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of CPU cores enabled on the Db node.""" + db_node_storage_size_in_gbs: Optional[int] = rest_field( + name="dbNodeStorageSizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The allocated local node storage in GBs on the Db node.""" + fault_domain: Optional[str] = rest_field( + name="faultDomain", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the Fault Domain the instance is contained in.""" + hostname: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The host name for the database node.""" + lifecycle_state: Optional[Union[str, "_models.DbNodeProvisioningState"]] = rest_field( + name="lifecycleState", visibility=["read", "create", "update", "delete", "query"] + ) + """The current state of the database node. Known values are: \"Provisioning\", \"Available\", + \"Updating\", \"Stopping\", \"Stopped\", \"Starting\", \"Terminating\", \"Terminated\", and + \"Failed\".""" + maintenance_type: Optional[str] = rest_field( + name="maintenanceType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of database node maintenance.""" + memory_size_in_gbs: Optional[int] = rest_field( + name="memorySizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """The allocated memory in GBs on the Db node.""" + software_storage_size_in_gb: Optional[int] = rest_field( + name="softwareStorageSizeInGb", visibility=["read", "create", "update", "delete", "query"] + ) + """The size (in GB) of the block storage volume allocation for the DB system. This attribute + applies only for virtual machine DB systems.""" + time_maintenance_window_end: Optional[datetime.datetime] = rest_field( + name="timeMaintenanceWindowEnd", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """End date and time of maintenance window.""" + time_maintenance_window_start: Optional[datetime.datetime] = rest_field( + name="timeMaintenanceWindowStart", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Start date and time of maintenance window.""" + total_cpu_core_count: Optional[int] = rest_field( + name="totalCpuCoreCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The total number of CPU cores reserved on the Db node.""" + + @overload + def __init__( + self, + *, + ocid: str, + additional_details: Optional[str] = None, + cpu_core_count: Optional[int] = None, + db_node_storage_size_in_gbs: Optional[int] = None, + fault_domain: Optional[str] = None, + hostname: Optional[str] = None, + lifecycle_state: Optional[Union[str, "_models.DbNodeProvisioningState"]] = None, + maintenance_type: Optional[str] = None, + memory_size_in_gbs: Optional[int] = None, + software_storage_size_in_gb: Optional[int] = None, + time_maintenance_window_end: Optional[datetime.datetime] = None, + time_maintenance_window_start: Optional[datetime.datetime] = None, + total_cpu_core_count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExascaleDbStorageDetails(_Model): + """Exadata Database Storage Details. + + :ivar available_size_in_gbs: Available Capacity. + :vartype available_size_in_gbs: int + :ivar total_size_in_gbs: Total Capacity. + :vartype total_size_in_gbs: int + """ + + available_size_in_gbs: Optional[int] = rest_field( + name="availableSizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """Available Capacity.""" + total_size_in_gbs: Optional[int] = rest_field( + name="totalSizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """Total Capacity.""" + + @overload + def __init__( + self, + *, + available_size_in_gbs: Optional[int] = None, + total_size_in_gbs: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExascaleDbStorageInputDetails(_Model): + """Create exadata Database Storage Details model. + + :ivar total_size_in_gbs: Total Capacity. Required. + :vartype total_size_in_gbs: int + """ + + total_size_in_gbs: int = rest_field( + name="totalSizeInGbs", visibility=["read", "create", "update", "delete", "query"] + ) + """Total Capacity. Required.""" + + @overload + def __init__( + self, + *, + total_size_in_gbs: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExascaleDbStorageVault(TrackedResource): + """ExascaleDbStorageVault resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultProperties + :ivar zones: The availability zones. + :vartype zones: list[str] + """ + + properties: Optional["_models.ExascaleDbStorageVaultProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + zones: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The availability zones.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ExascaleDbStorageVaultProperties"] = None, + zones: Optional[List[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExascaleDbStorageVaultProperties(_Model): + """ExascaleDbStorageVault resource model. + + :ivar additional_flash_cache_in_percent: The size of additional Flash Cache in percentage of + High Capacity database storage. + :vartype additional_flash_cache_in_percent: int + :ivar description: Exadata Database Storage Vault description. + :vartype description: str + :ivar display_name: The user-friendly name for the Exadata Database Storage Vault. The name + does not need to be unique. Required. + :vartype display_name: str + :ivar high_capacity_database_storage_input: Create exadata Database Storage Details. Required. + :vartype high_capacity_database_storage_input: + ~azure.mgmt.oracledatabase.models.ExascaleDbStorageInputDetails + :ivar high_capacity_database_storage: Response exadata Database Storage Details. + :vartype high_capacity_database_storage: + ~azure.mgmt.oracledatabase.models.ExascaleDbStorageDetails + :ivar time_zone: The time zone that you want to use for the Exadata Database Storage Vault. + :vartype time_zone: str + :ivar provisioning_state: Exadata Database Storage Vault provisioning state. Known values are: + "Succeeded", "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: Exadata Database Storage Vault lifecycle state. Known values are: + "Provisioning", "Available", "Updating", "Terminating", "Terminated", and "Failed". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultLifecycleState + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar vm_cluster_count: The number of Exadata VM clusters used the Exadata Database Storage + Vault. + :vartype vm_cluster_count: int + :ivar ocid: The OCID of the Exadata Database Storage Vault. + :vartype ocid: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + """ + + additional_flash_cache_in_percent: Optional[int] = rest_field( + name="additionalFlashCacheInPercent", visibility=["read", "create"] + ) + """The size of additional Flash Cache in percentage of High Capacity database storage.""" + description: Optional[str] = rest_field(visibility=["read", "create"]) + """Exadata Database Storage Vault description.""" + display_name: str = rest_field(name="displayName", visibility=["read", "create"]) + """The user-friendly name for the Exadata Database Storage Vault. The name does not need to be + unique. Required.""" + high_capacity_database_storage_input: "_models.ExascaleDbStorageInputDetails" = rest_field( + name="highCapacityDatabaseStorageInput", visibility=["create"] + ) + """Create exadata Database Storage Details. Required.""" + high_capacity_database_storage: Optional["_models.ExascaleDbStorageDetails"] = rest_field( + name="highCapacityDatabaseStorage", visibility=["read"] + ) + """Response exadata Database Storage Details.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create"]) + """The time zone that you want to use for the Exadata Database Storage Vault.""" + provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Exadata Database Storage Vault provisioning state. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", and \"Provisioning\".""" + lifecycle_state: Optional[Union[str, "_models.ExascaleDbStorageVaultLifecycleState"]] = rest_field( + name="lifecycleState", visibility=["read"] + ) + """Exadata Database Storage Vault lifecycle state. Known values are: \"Provisioning\", + \"Available\", \"Updating\", \"Terminating\", \"Terminated\", and \"Failed\".""" + lifecycle_details: Optional[str] = rest_field(name="lifecycleDetails", visibility=["read"]) + """Additional information about the current lifecycle state.""" + vm_cluster_count: Optional[int] = rest_field(name="vmClusterCount", visibility=["read"]) + """The number of Exadata VM clusters used the Exadata Database Storage Vault.""" + ocid: Optional[str] = rest_field(visibility=["read"]) + """The OCID of the Exadata Database Storage Vault.""" + oci_url: Optional[str] = rest_field(name="ociUrl", visibility=["read"]) + """HTTPS link to OCI resources exposed to Azure Customer via Azure Interface.""" + + @overload + def __init__( + self, + *, + display_name: str, + high_capacity_database_storage_input: "_models.ExascaleDbStorageInputDetails", + additional_flash_cache_in_percent: Optional[int] = None, + description: Optional[str] = None, + time_zone: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExascaleDbStorageVaultTagsUpdate(_Model): + """The type used for updating tags in ExascaleDbStorageVault resources. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FileSystemConfigurationDetails(_Model): + """File configuration options. + + :ivar mount_point: Mount path. + :vartype mount_point: str + :ivar file_system_size_gb: Size of the VM. + :vartype file_system_size_gb: int + """ + + mount_point: Optional[str] = rest_field( + name="mountPoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Mount path.""" + file_system_size_gb: Optional[int] = rest_field( + name="fileSystemSizeGb", visibility=["read", "create", "update", "delete", "query"] + ) + """Size of the VM.""" + + @overload + def __init__( + self, + *, + mount_point: Optional[str] = None, + file_system_size_gb: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlexComponent(ProxyResource): + """FlexComponent Resource Definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.FlexComponentProperties + """ + + properties: Optional["_models.FlexComponentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.FlexComponentProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FlexComponentProperties(_Model): + """FlexComponent resource model. + + :ivar minimum_core_count: The minimum number of CPU cores that can be enabled on the DB Server + for this Flex Component. + :vartype minimum_core_count: int + :ivar available_core_count: The maximum number of CPU cores that can be enabled on the DB + Server for this Flex Component. + :vartype available_core_count: int + :ivar available_db_storage_in_gbs: The maximum storage that can be enabled on the Storage + Server for this Flex Component. + :vartype available_db_storage_in_gbs: int + :ivar runtime_minimum_core_count: The runtime minimum number of CPU cores that can be enabled + for this Flex Component. + :vartype runtime_minimum_core_count: int + :ivar shape: The name of the DB system shape for this Flex Component. + :vartype shape: str + :ivar available_memory_in_gbs: The maximum memory size that can be enabled on the DB Server for + this Flex Component. + :vartype available_memory_in_gbs: int + :ivar available_local_storage_in_gbs: The maximum local storage that can be enabled on the DB + Server for this Flex Component. + :vartype available_local_storage_in_gbs: int + :ivar compute_model: The compute model of the DB Server for this Flex Component. + :vartype compute_model: str + :ivar hardware_type: The hardware type of the DB (Compute) or Storage (Cell) Server for this + Flex Component. Known values are: "COMPUTE" and "CELL". + :vartype hardware_type: str or ~azure.mgmt.oracledatabase.models.HardwareType + :ivar description_summary: The description summary for this Flex Component. + :vartype description_summary: str + """ + + minimum_core_count: Optional[int] = rest_field(name="minimumCoreCount", visibility=["read"]) + """The minimum number of CPU cores that can be enabled on the DB Server for this Flex Component.""" + available_core_count: Optional[int] = rest_field(name="availableCoreCount", visibility=["read"]) + """The maximum number of CPU cores that can be enabled on the DB Server for this Flex Component.""" + available_db_storage_in_gbs: Optional[int] = rest_field(name="availableDbStorageInGbs", visibility=["read"]) + """The maximum storage that can be enabled on the Storage Server for this Flex Component.""" + runtime_minimum_core_count: Optional[int] = rest_field(name="runtimeMinimumCoreCount", visibility=["read"]) + """The runtime minimum number of CPU cores that can be enabled for this Flex Component.""" + shape: Optional[str] = rest_field(visibility=["read"]) + """The name of the DB system shape for this Flex Component.""" + available_memory_in_gbs: Optional[int] = rest_field(name="availableMemoryInGbs", visibility=["read"]) + """The maximum memory size that can be enabled on the DB Server for this Flex Component.""" + available_local_storage_in_gbs: Optional[int] = rest_field(name="availableLocalStorageInGbs", visibility=["read"]) + """The maximum local storage that can be enabled on the DB Server for this Flex Component.""" + compute_model: Optional[str] = rest_field(name="computeModel", visibility=["read"]) + """The compute model of the DB Server for this Flex Component.""" + hardware_type: Optional[Union[str, "_models.HardwareType"]] = rest_field(name="hardwareType", visibility=["read"]) + """The hardware type of the DB (Compute) or Storage (Cell) Server for this Flex Component. Known + values are: \"COMPUTE\" and \"CELL\".""" + description_summary: Optional[str] = rest_field(name="descriptionSummary", visibility=["read"]) + """The description summary for this Flex Component.""" + + +class GenerateAutonomousDatabaseWalletDetails(_Model): + """Autonomous Database Generate Wallet resource model. + + :ivar generate_type: The type of wallet to generate. Known values are: "Single" and "All". + :vartype generate_type: str or ~azure.mgmt.oracledatabase.models.GenerateType + :ivar is_regional: True when requesting regional connection strings in PDB connect info, + applicable to cross-region DG only. + :vartype is_regional: bool + :ivar password: The password to encrypt the keys inside the wallet. Required. + :vartype password: str + """ + + generate_type: Optional[Union[str, "_models.GenerateType"]] = rest_field( + name="generateType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of wallet to generate. Known values are: \"Single\" and \"All\".""" + is_regional: Optional[bool] = rest_field( + name="isRegional", visibility=["read", "create", "update", "delete", "query"] + ) + """True when requesting regional connection strings in PDB connect info, applicable to + cross-region DG only.""" + password: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The password to encrypt the keys inside the wallet. Required.""" + + @overload + def __init__( + self, + *, + password: str, + generate_type: Optional[Union[str, "_models.GenerateType"]] = None, + is_regional: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GiMinorVersion(ProxyResource): + """The Oracle Grid Infrastructure (GI) minor version resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.GiMinorVersionProperties + """ + + properties: Optional["_models.GiMinorVersionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.GiMinorVersionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GiMinorVersionProperties(_Model): + """The Oracle Grid Infrastructure (GI) minor version properties. + + :ivar version: A valid Oracle Grid Infrastructure (GI) software version. Required. + :vartype version: str + :ivar grid_image_ocid: Grid Infrastructure Image Id. + :vartype grid_image_ocid: str + """ + + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A valid Oracle Grid Infrastructure (GI) software version. Required.""" + grid_image_ocid: Optional[str] = rest_field( + name="gridImageOcid", visibility=["read", "create", "update", "delete", "query"] + ) + """Grid Infrastructure Image Id.""" + + @overload + def __init__( + self, + *, + version: str, + grid_image_ocid: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GiVersion(ProxyResource): + """GiVersion resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.GiVersionProperties + """ + + properties: Optional["_models.GiVersionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.GiVersionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GiVersionProperties(_Model): + """GiVersion resource model. + + :ivar version: A valid Oracle Grid Infrastructure (GI) software version. Required. + :vartype version: str + """ + + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A valid Oracle Grid Infrastructure (GI) software version. Required.""" + + @overload + def __init__( + self, + *, + version: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LongTermBackUpScheduleDetails(_Model): + """Details for the long-term backup schedule. + + :ivar repeat_cadence: The frequency of the long-term backup schedule. Known values are: + "OneTime", "Weekly", "Monthly", and "Yearly". + :vartype repeat_cadence: str or ~azure.mgmt.oracledatabase.models.RepeatCadenceType + :ivar time_of_backup: The timestamp for the long-term backup schedule. For a MONTHLY cadence, + months having fewer days than the provided date will have the backup taken on the last day of + that month. + :vartype time_of_backup: ~datetime.datetime + :ivar retention_period_in_days: Retention period, in days, for backups. + :vartype retention_period_in_days: int + :ivar is_disabled: Indicates if the long-term backup schedule should be deleted. The default + value is ``FALSE``. + :vartype is_disabled: bool + """ + + repeat_cadence: Optional[Union[str, "_models.RepeatCadenceType"]] = rest_field( + name="repeatCadence", visibility=["read", "create", "update", "delete", "query"] + ) + """The frequency of the long-term backup schedule. Known values are: \"OneTime\", \"Weekly\", + \"Monthly\", and \"Yearly\".""" + time_of_backup: Optional[datetime.datetime] = rest_field( + name="timeOfBackup", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer + days than the provided date will have the backup taken on the last day of that month.""" + retention_period_in_days: Optional[int] = rest_field( + name="retentionPeriodInDays", visibility=["read", "create", "update", "delete", "query"] + ) + """Retention period, in days, for backups.""" + is_disabled: Optional[bool] = rest_field( + name="isDisabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates if the long-term backup schedule should be deleted. The default value is ``FALSE``.""" + + @overload + def __init__( + self, + *, + repeat_cadence: Optional[Union[str, "_models.RepeatCadenceType"]] = None, + time_of_backup: Optional[datetime.datetime] = None, + retention_period_in_days: Optional[int] = None, + is_disabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceWindow(_Model): + """MaintenanceWindow resource properties. + + :ivar preference: The maintenance window scheduling preference. Known values are: + "NoPreference" and "CustomPreference". + :vartype preference: str or ~azure.mgmt.oracledatabase.models.Preference + :ivar months: Months during the year when maintenance should be performed. + :vartype months: list[~azure.mgmt.oracledatabase.models.Month] + :ivar weeks_of_month: Weeks during the month when maintenance should be performed. Weeks start + on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start + and end based on calendar dates, not days of the week. For example, to allow maintenance during + the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. + Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. + Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to + allow you to specify specific days of the week and hours that maintenance will be performed. + :vartype weeks_of_month: list[int] + :ivar days_of_week: Days during the week when maintenance should be performed. + :vartype days_of_week: list[~azure.mgmt.oracledatabase.models.DayOfWeek] + :ivar hours_of_day: The window of hours during the day when maintenance should be performed. + The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - + represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - + represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - + represents time slot 20:00 - 23:59 UTC. + :vartype hours_of_day: list[int] + :ivar lead_time_in_weeks: Lead time window allows user to set a lead time to prepare for a down + time. The lead time is in weeks and valid value is between 1 to 4. + :vartype lead_time_in_weeks: int + :ivar patching_mode: Cloud Exadata infrastructure node patching method. Known values are: + "Rolling" and "NonRolling". + :vartype patching_mode: str or ~azure.mgmt.oracledatabase.models.PatchingMode + :ivar custom_action_timeout_in_mins: Determines the amount of time the system will wait before + the start of each database server patching operation. Custom action timeout is in minutes and + valid value is between 15 to 120 (inclusive). + :vartype custom_action_timeout_in_mins: int + :ivar is_custom_action_timeout_enabled: If true, enables the configuration of a custom action + timeout (waiting period) between database server patching operations. + :vartype is_custom_action_timeout_enabled: bool + :ivar is_monthly_patching_enabled: is Monthly Patching Enabled. + :vartype is_monthly_patching_enabled: bool + """ + + preference: Optional[Union[str, "_models.Preference"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The maintenance window scheduling preference. Known values are: \"NoPreference\" and + \"CustomPreference\".""" + months: Optional[List["_models.Month"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Months during the year when maintenance should be performed.""" + weeks_of_month: Optional[List[int]] = rest_field( + name="weeksOfMonth", visibility=["read", "create", "update", "delete", "query"] + ) + """Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, + and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on + calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of + the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot + be scheduled for the fifth week of months that contain more than 28 days. Note that this + parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to + specify specific days of the week and hours that maintenance will be performed.""" + days_of_week: Optional[List["_models.DayOfWeek"]] = rest_field( + name="daysOfWeek", visibility=["read", "create", "update", "delete", "query"] + ) + """Days during the week when maintenance should be performed.""" + hours_of_day: Optional[List[int]] = rest_field( + name="hoursOfDay", visibility=["read", "create", "update", "delete", "query"] + ) + """The window of hours during the day when maintenance should be performed. The window is a 4 hour + slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot + 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - + 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - + 23:59 UTC.""" + lead_time_in_weeks: Optional[int] = rest_field( + name="leadTimeInWeeks", visibility=["read", "create", "update", "delete", "query"] + ) + """Lead time window allows user to set a lead time to prepare for a down time. The lead time is in + weeks and valid value is between 1 to 4.""" + patching_mode: Optional[Union[str, "_models.PatchingMode"]] = rest_field( + name="patchingMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Cloud Exadata infrastructure node patching method. Known values are: \"Rolling\" and + \"NonRolling\".""" + custom_action_timeout_in_mins: Optional[int] = rest_field( + name="customActionTimeoutInMins", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines the amount of time the system will wait before the start of each database server + patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 + (inclusive).""" + is_custom_action_timeout_enabled: Optional[bool] = rest_field( + name="isCustomActionTimeoutEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """If true, enables the configuration of a custom action timeout (waiting period) between database + server patching operations.""" + is_monthly_patching_enabled: Optional[bool] = rest_field( + name="isMonthlyPatchingEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """is Monthly Patching Enabled.""" + + @overload + def __init__( + self, + *, + preference: Optional[Union[str, "_models.Preference"]] = None, + months: Optional[List["_models.Month"]] = None, + weeks_of_month: Optional[List[int]] = None, + days_of_week: Optional[List["_models.DayOfWeek"]] = None, + hours_of_day: Optional[List[int]] = None, + lead_time_in_weeks: Optional[int] = None, + patching_mode: Optional[Union[str, "_models.PatchingMode"]] = None, + custom_action_timeout_in_mins: Optional[int] = None, + is_custom_action_timeout_enabled: Optional[bool] = None, + is_monthly_patching_enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Month(_Model): + """Month resource properties. + + :ivar name: Name of the month of the year. Required. Known values are: "January", "February", + "March", "April", "May", "June", "July", "August", "September", "October", "November", and + "December". + :vartype name: str or ~azure.mgmt.oracledatabase.models.MonthName + """ + + name: Union[str, "_models.MonthName"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the month of the year. Required. Known values are: \"January\", \"February\", + \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", + \"November\", and \"December\".""" + + @overload + def __init__( + self, + *, + name: Union[str, "_models.MonthName"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NsgCidr(_Model): + """A rule for allowing inbound (INGRESS) IP packets. + + :ivar source: Conceptually, this is the range of IP addresses that a packet coming into the + instance can come from. Required. + :vartype source: str + :ivar destination_port_range: Destination port range to specify particular destination ports + for TCP rules. + :vartype destination_port_range: ~azure.mgmt.oracledatabase.models.PortRange + """ + + source: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Conceptually, this is the range of IP addresses that a packet coming into the instance can come + from. Required.""" + destination_port_range: Optional["_models.PortRange"] = rest_field( + name="destinationPortRange", visibility=["read", "create", "update", "delete", "query"] + ) + """Destination port range to specify particular destination ports for TCP rules.""" + + @overload + def __init__( + self, + *, + source: str, + destination_port_range: Optional["_models.PortRange"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): + """REST API Operation. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.oracledatabase.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.oracledatabase.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.oracledatabase.models.ActionType + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDisplay(_Model): + """Localized display information for and operation. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class OracleSubscription(ProxyResource): + """OracleSubscription resource definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionProperties + :ivar plan: Details of the resource plan. + :vartype plan: ~azure.mgmt.oracledatabase.models.Plan + """ + + properties: Optional["_models.OracleSubscriptionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + plan: Optional["_models.Plan"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Details of the resource plan.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.OracleSubscriptionProperties"] = None, + plan: Optional["_models.Plan"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OracleSubscriptionProperties(_Model): + """Oracle Subscription resource model. + + :ivar provisioning_state: OracleSubscriptionProvisioningState provisioning state. Known values + are: "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.OracleSubscriptionProvisioningState + :ivar saas_subscription_id: SAAS subscription ID generated by Marketplace. + :vartype saas_subscription_id: str + :ivar cloud_account_id: Cloud Account Id. + :vartype cloud_account_id: str + :ivar cloud_account_state: Cloud Account provisioning state. Known values are: "Pending", + "Provisioning", and "Available". + :vartype cloud_account_state: str or + ~azure.mgmt.oracledatabase.models.CloudAccountProvisioningState + :ivar term_unit: Term Unit. P1Y, P3Y, etc, see Durations + `https://en.wikipedia.org/wiki/ISO_8601 `_. + :vartype term_unit: str + :ivar product_code: Product code for the term unit. + :vartype product_code: str + :ivar intent: Intent for the update operation. Known values are: "Retain" and "Reset". + :vartype intent: str or ~azure.mgmt.oracledatabase.models.Intent + :ivar azure_subscription_ids: Azure subscriptions to be added. + :vartype azure_subscription_ids: list[str] + :ivar add_subscription_operation_state: State of the add Azure subscription operation on Oracle + subscription. Known values are: "Succeeded", "Updating", and "Failed". + :vartype add_subscription_operation_state: str or + ~azure.mgmt.oracledatabase.models.AddSubscriptionOperationState + :ivar last_operation_status_detail: Status details of the last operation on Oracle + subscription. + :vartype last_operation_status_detail: str + """ + + provisioning_state: Optional[Union[str, "_models.OracleSubscriptionProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """OracleSubscriptionProvisioningState provisioning state. Known values are: \"Succeeded\", + \"Failed\", and \"Canceled\".""" + saas_subscription_id: Optional[str] = rest_field(name="saasSubscriptionId", visibility=["read"]) + """SAAS subscription ID generated by Marketplace.""" + cloud_account_id: Optional[str] = rest_field(name="cloudAccountId", visibility=["read"]) + """Cloud Account Id.""" + cloud_account_state: Optional[Union[str, "_models.CloudAccountProvisioningState"]] = rest_field( + name="cloudAccountState", visibility=["read"] + ) + """Cloud Account provisioning state. Known values are: \"Pending\", \"Provisioning\", and + \"Available\".""" + term_unit: Optional[str] = rest_field(name="termUnit", visibility=["read", "create"]) + """Term Unit. P1Y, P3Y, etc, see Durations `https://en.wikipedia.org/wiki/ISO_8601 + `_.""" + product_code: Optional[str] = rest_field(name="productCode", visibility=["update"]) + """Product code for the term unit.""" + intent: Optional[Union[str, "_models.Intent"]] = rest_field(visibility=["update"]) + """Intent for the update operation. Known values are: \"Retain\" and \"Reset\".""" + azure_subscription_ids: Optional[List[str]] = rest_field(name="azureSubscriptionIds", visibility=["read"]) + """Azure subscriptions to be added.""" + add_subscription_operation_state: Optional[Union[str, "_models.AddSubscriptionOperationState"]] = rest_field( + name="addSubscriptionOperationState", visibility=["read"] + ) + """State of the add Azure subscription operation on Oracle subscription. Known values are: + \"Succeeded\", \"Updating\", and \"Failed\".""" + last_operation_status_detail: Optional[str] = rest_field(name="lastOperationStatusDetail", visibility=["read"]) + """Status details of the last operation on Oracle subscription.""" + + @overload + def __init__( + self, + *, + term_unit: Optional[str] = None, + product_code: Optional[str] = None, + intent: Optional[Union[str, "_models.Intent"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OracleSubscriptionUpdate(_Model): + """The type used for update operations of the OracleSubscription. + + :ivar plan: Details of the resource plan. + :vartype plan: ~azure.mgmt.oracledatabase.models.PlanUpdate + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdateProperties + """ + + plan: Optional["_models.PlanUpdate"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Details of the resource plan.""" + properties: Optional["_models.OracleSubscriptionUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + plan: Optional["_models.PlanUpdate"] = None, + properties: Optional["_models.OracleSubscriptionUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OracleSubscriptionUpdateProperties(_Model): + """The updatable properties of the OracleSubscription. + + :ivar product_code: Product code for the term unit. + :vartype product_code: str + :ivar intent: Intent for the update operation. Known values are: "Retain" and "Reset". + :vartype intent: str or ~azure.mgmt.oracledatabase.models.Intent + """ + + product_code: Optional[str] = rest_field(name="productCode", visibility=["update"]) + """Product code for the term unit.""" + intent: Optional[Union[str, "_models.Intent"]] = rest_field(visibility=["update"]) + """Intent for the update operation. Known values are: \"Retain\" and \"Reset\".""" + + @overload + def __init__( + self, + *, + product_code: Optional[str] = None, + intent: Optional[Union[str, "_models.Intent"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PeerDbDetails(_Model): + """PeerDb Details. + + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :vartype peer_db_id: str + :ivar peer_db_ocid: Ocid of the Disaster Recovery peer database, which is located in a + different region from the current peer database. + :vartype peer_db_ocid: str + :ivar peer_db_location: The location of the Disaster Recovery peer database. + :vartype peer_db_location: str + """ + + peer_db_id: Optional[str] = rest_field(name="peerDbId", visibility=["read", "create", "update", "delete", "query"]) + """The Azure resource ID of the Disaster Recovery peer database, which is located in a different + region from the current peer database.""" + peer_db_ocid: Optional[str] = rest_field( + name="peerDbOcid", visibility=["read", "create", "update", "delete", "query"] + ) + """Ocid of the Disaster Recovery peer database, which is located in a different region from the + current peer database.""" + peer_db_location: Optional[str] = rest_field( + name="peerDbLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """The location of the Disaster Recovery peer database.""" + + @overload + def __init__( + self, + *, + peer_db_id: Optional[str] = None, + peer_db_ocid: Optional[str] = None, + peer_db_location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Plan(_Model): + """Plan for the resource. + + :ivar name: A user defined name of the 3rd Party Artifact that is being procured. Required. + :vartype name: str + :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + Required. + :vartype publisher: str + :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. Required. + :vartype product: str + :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the + said product/artifact. + :vartype promotion_code: str + :ivar version: The version of the desired product/artifact. + :vartype version: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A user defined name of the 3rd Party Artifact that is being procured. Required.""" + publisher: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. Required.""" + product: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID + specified for the artifact at the time of Data Market onboarding. Required.""" + promotion_code: Optional[str] = rest_field( + name="promotionCode", visibility=["read", "create", "update", "delete", "query"] + ) + """A publisher provided promotion code as provisioned in Data Market for the said + product/artifact.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the desired product/artifact.""" + + @overload + def __init__( + self, + *, + name: str, + publisher: str, + product: str, + promotion_code: Optional[str] = None, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PlanUpdate(_Model): + """ResourcePlanTypeUpdate model definition. + + :ivar name: A user defined name of the 3rd Party Artifact that is being procured. + :vartype name: str + :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + :vartype publisher: str + :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to + the OfferID specified for the artifact at the time of Data Market onboarding. + :vartype product: str + :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the + said product/artifact. + :vartype promotion_code: str + :ivar version: The version of the desired product/artifact. + :vartype version: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A user defined name of the 3rd Party Artifact that is being procured.""" + publisher: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic.""" + product: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID + specified for the artifact at the time of Data Market onboarding.""" + promotion_code: Optional[str] = rest_field( + name="promotionCode", visibility=["read", "create", "update", "delete", "query"] + ) + """A publisher provided promotion code as provisioned in Data Market for the said + product/artifact.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the desired product/artifact.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + publisher: Optional[str] = None, + product: Optional[str] = None, + promotion_code: Optional[str] = None, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PortRange(_Model): + """Port Range to specify particular destination ports for TCP rules. + + :ivar min: The minimum port number, which must not be greater than the maximum port number. + Required. + :vartype min: int + :ivar max: The maximum port number, which must not be less than the minimum port number. To + specify a single port number, set both the min and max to the same value. Required. + :vartype max: int + """ + + min: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The minimum port number, which must not be greater than the maximum port number. Required.""" + max: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum port number, which must not be less than the minimum port number. To specify a + single port number, set both the min and max to the same value. Required.""" + + @overload + def __init__( + self, + *, + min: int, # pylint: disable=redefined-builtin + max: int, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateIpAddressesFilter(_Model): + """Private Ip Addresses filter. + + :ivar subnet_id: Subnet OCID. Required. + :vartype subnet_id: str + :ivar vnic_id: VCN OCID. Required. + :vartype vnic_id: str + """ + + subnet_id: str = rest_field(name="subnetId", visibility=["read", "create", "update", "delete", "query"]) + """Subnet OCID. Required.""" + vnic_id: str = rest_field(name="vnicId", visibility=["read", "create", "update", "delete", "query"]) + """VCN OCID. Required.""" + + @overload + def __init__( + self, + *, + subnet_id: str, + vnic_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateIpAddressProperties(_Model): + """PrivateIpAddress resource properties. + + :ivar display_name: PrivateIpAddresses displayName. Required. + :vartype display_name: str + :ivar hostname_label: PrivateIpAddresses hostnameLabel. Required. + :vartype hostname_label: str + :ivar ocid: PrivateIpAddresses Id. Required. + :vartype ocid: str + :ivar ip_address: PrivateIpAddresses ipAddress. Required. + :vartype ip_address: str + :ivar subnet_id: PrivateIpAddresses subnetId. Required. + :vartype subnet_id: str + """ + + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) + """PrivateIpAddresses displayName. Required.""" + hostname_label: str = rest_field(name="hostnameLabel", visibility=["read", "create", "update", "delete", "query"]) + """PrivateIpAddresses hostnameLabel. Required.""" + ocid: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """PrivateIpAddresses Id. Required.""" + ip_address: str = rest_field(name="ipAddress", visibility=["read", "create", "update", "delete", "query"]) + """PrivateIpAddresses ipAddress. Required.""" + subnet_id: str = rest_field(name="subnetId", visibility=["read", "create", "update", "delete", "query"]) + """PrivateIpAddresses subnetId. Required.""" + + @overload + def __init__( + self, + *, + display_name: str, + hostname_label: str, + ocid: str, + ip_address: str, + subnet_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProfileType(_Model): + """The connection string profile to allow clients to group, filter and select connection string + values based on structured metadata. + + :ivar consumer_group: Consumer group used by the connection. Known values are: "High", + "Medium", "Low", "Tp", and "Tpurgent". + :vartype consumer_group: str or ~azure.mgmt.oracledatabase.models.ConsumerGroup + :ivar display_name: A user-friendly name for the connection. Required. + :vartype display_name: str + :ivar host_format: Host format used in connection string. Required. Known values are: "Fqdn" + and "Ip". + :vartype host_format: str or ~azure.mgmt.oracledatabase.models.HostFormatType + :ivar is_regional: True for a regional connection string, applicable to cross-region DG only. + :vartype is_regional: bool + :ivar protocol: Protocol used by the connection. Required. Known values are: "TCP" and "TCPS". + :vartype protocol: str or ~azure.mgmt.oracledatabase.models.ProtocolType + :ivar session_mode: Specifies whether the listener performs a direct hand-off of the session, + or redirects the session. Required. Known values are: "Direct" and "Redirect". + :vartype session_mode: str or ~azure.mgmt.oracledatabase.models.SessionModeType + :ivar syntax_format: Specifies whether the connection string is using the long (LONG), Easy + Connect (EZCONNECT), or Easy Connect Plus (EZCONNECTPLUS) format. Required. Known values are: + "Long", "Ezconnect", and "Ezconnectplus". + :vartype syntax_format: str or ~azure.mgmt.oracledatabase.models.SyntaxFormatType + :ivar tls_authentication: Specifies whether the TLS handshake is using one-way (SERVER) or + mutual (MUTUAL) authentication. Known values are: "Server" and "Mutual". + :vartype tls_authentication: str or ~azure.mgmt.oracledatabase.models.TlsAuthenticationType + :ivar value: Connection string value. Required. + :vartype value: str + """ + + consumer_group: Optional[Union[str, "_models.ConsumerGroup"]] = rest_field( + name="consumerGroup", visibility=["read", "create", "update", "delete", "query"] + ) + """Consumer group used by the connection. Known values are: \"High\", \"Medium\", \"Low\", \"Tp\", + and \"Tpurgent\".""" + display_name: str = rest_field(name="displayName", visibility=["read", "create", "update", "delete", "query"]) + """A user-friendly name for the connection. Required.""" + host_format: Union[str, "_models.HostFormatType"] = rest_field( + name="hostFormat", visibility=["read", "create", "update", "delete", "query"] + ) + """Host format used in connection string. Required. Known values are: \"Fqdn\" and \"Ip\".""" + is_regional: Optional[bool] = rest_field( + name="isRegional", visibility=["read", "create", "update", "delete", "query"] + ) + """True for a regional connection string, applicable to cross-region DG only.""" + protocol: Union[str, "_models.ProtocolType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Protocol used by the connection. Required. Known values are: \"TCP\" and \"TCPS\".""" + session_mode: Union[str, "_models.SessionModeType"] = rest_field( + name="sessionMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether the listener performs a direct hand-off of the session, or redirects the + session. Required. Known values are: \"Direct\" and \"Redirect\".""" + syntax_format: Union[str, "_models.SyntaxFormatType"] = rest_field( + name="syntaxFormat", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether the connection string is using the long (LONG), Easy Connect (EZCONNECT), or + Easy Connect Plus (EZCONNECTPLUS) format. Required. Known values are: \"Long\", \"Ezconnect\", + and \"Ezconnectplus\".""" + tls_authentication: Optional[Union[str, "_models.TlsAuthenticationType"]] = rest_field( + name="tlsAuthentication", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether the TLS handshake is using one-way (SERVER) or mutual (MUTUAL) + authentication. Known values are: \"Server\" and \"Mutual\".""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Connection string value. Required.""" + + @overload + def __init__( + self, + *, + display_name: str, + host_format: Union[str, "_models.HostFormatType"], + protocol: Union[str, "_models.ProtocolType"], + session_mode: Union[str, "_models.SessionModeType"], + syntax_format: Union[str, "_models.SyntaxFormatType"], + value: str, + consumer_group: Optional[Union[str, "_models.ConsumerGroup"]] = None, + is_regional: Optional[bool] = None, + tls_authentication: Optional[Union[str, "_models.TlsAuthenticationType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RemoveVirtualMachineFromExadbVmClusterDetails(_Model): # pylint: disable=name-too-long + """Details of removing Virtual Machines from the Exadata VM cluster on Exascale Infrastructure. + Applies to Exadata Database Service on Exascale Infrastructure only. + + :ivar db_nodes: The list of ExaCS DB nodes for the Exadata VM cluster on Exascale + Infrastructure to be removed. Required. + :vartype db_nodes: list[~azure.mgmt.oracledatabase.models.DbNodeDetails] + """ + + db_nodes: List["_models.DbNodeDetails"] = rest_field( + name="dbNodes", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of ExaCS DB nodes for the Exadata VM cluster on Exascale Infrastructure to be removed. + Required.""" + + @overload + def __init__( + self, + *, + db_nodes: List["_models.DbNodeDetails"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RestoreAutonomousDatabaseDetails(_Model): + """Details to restore an Oracle Autonomous Database. + + :ivar timestamp: The time to restore the database to. Required. + :vartype timestamp: ~datetime.datetime + """ + + timestamp: datetime.datetime = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time to restore the database to. Required.""" + + @overload + def __init__( + self, + *, + timestamp: datetime.datetime, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SaasSubscriptionDetails(_Model): + """SaaS Subscription Details model. + + :ivar id: Purchased SaaS subscription ID. + :vartype id: str + :ivar subscription_name: SaaS subscription name. + :vartype subscription_name: str + :ivar time_created: Creation Date and Time. + :vartype time_created: ~datetime.datetime + :ivar offer_id: Purchased offer ID. + :vartype offer_id: str + :ivar plan_id: Purchased offer's plan ID. + :vartype plan_id: str + :ivar saas_subscription_status: Indicates the status of the Subscription. + :vartype saas_subscription_status: str + :ivar publisher_id: Publisher ID. + :vartype publisher_id: str + :ivar purchaser_email_id: Purchaser Email ID. + :vartype purchaser_email_id: str + :ivar purchaser_tenant_id: Purchaser Tenant ID. + :vartype purchaser_tenant_id: str + :ivar term_unit: Purchase Term Unit. + :vartype term_unit: str + :ivar is_auto_renew: AutoRenew flag. + :vartype is_auto_renew: bool + :ivar is_free_trial: FreeTrial flag. + :vartype is_free_trial: bool + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Purchased SaaS subscription ID.""" + subscription_name: Optional[str] = rest_field(name="subscriptionName", visibility=["read"]) + """SaaS subscription name.""" + time_created: Optional[datetime.datetime] = rest_field(name="timeCreated", visibility=["read"], format="rfc3339") + """Creation Date and Time.""" + offer_id: Optional[str] = rest_field(name="offerId", visibility=["read"]) + """Purchased offer ID.""" + plan_id: Optional[str] = rest_field(name="planId", visibility=["read"]) + """Purchased offer's plan ID.""" + saas_subscription_status: Optional[str] = rest_field(name="saasSubscriptionStatus", visibility=["read"]) + """Indicates the status of the Subscription.""" + publisher_id: Optional[str] = rest_field(name="publisherId", visibility=["read"]) + """Publisher ID.""" + purchaser_email_id: Optional[str] = rest_field(name="purchaserEmailId", visibility=["read"]) + """Purchaser Email ID.""" + purchaser_tenant_id: Optional[str] = rest_field(name="purchaserTenantId", visibility=["read"]) + """Purchaser Tenant ID.""" + term_unit: Optional[str] = rest_field(name="termUnit", visibility=["read"]) + """Purchase Term Unit.""" + is_auto_renew: Optional[bool] = rest_field(name="isAutoRenew", visibility=["read"]) + """AutoRenew flag.""" + is_free_trial: Optional[bool] = rest_field(name="isFreeTrial", visibility=["read"]) + """FreeTrial flag.""" + + +class ScheduledOperationsType(_Model): + """The list of scheduled operations. + + :ivar day_of_week: Day of week. Required. + :vartype day_of_week: ~azure.mgmt.oracledatabase.models.DayOfWeek + :ivar scheduled_start_time: auto start time. value must be of ISO-8601 format HH:mm. + :vartype scheduled_start_time: str + :ivar scheduled_stop_time: auto stop time. value must be of ISO-8601 format HH:mm. + :vartype scheduled_stop_time: str + """ + + day_of_week: "_models.DayOfWeek" = rest_field( + name="dayOfWeek", visibility=["read", "create", "update", "delete", "query"] + ) + """Day of week. Required.""" + scheduled_start_time: Optional[str] = rest_field( + name="scheduledStartTime", visibility=["read", "create", "update", "delete", "query"] + ) + """auto start time. value must be of ISO-8601 format HH:mm.""" + scheduled_stop_time: Optional[str] = rest_field( + name="scheduledStopTime", visibility=["read", "create", "update", "delete", "query"] + ) + """auto stop time. value must be of ISO-8601 format HH:mm.""" + + @overload + def __init__( + self, + *, + day_of_week: "_models.DayOfWeek", + scheduled_start_time: Optional[str] = None, + scheduled_stop_time: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ScheduledOperationsTypeUpdate(_Model): + """The list of scheduled operations. + + :ivar day_of_week: Day of week. Required. + :vartype day_of_week: ~azure.mgmt.oracledatabase.models.DayOfWeekUpdate + :ivar scheduled_start_time: auto start time. value must be of ISO-8601 format HH:mm. + :vartype scheduled_start_time: str + :ivar scheduled_stop_time: auto stop time. value must be of ISO-8601 format HH:mm. + :vartype scheduled_stop_time: str + """ + + day_of_week: "_models.DayOfWeekUpdate" = rest_field( + name="dayOfWeek", visibility=["read", "create", "update", "delete", "query"] + ) + """Day of week. Required.""" + scheduled_start_time: Optional[str] = rest_field( + name="scheduledStartTime", visibility=["read", "create", "update", "delete", "query"] + ) + """auto start time. value must be of ISO-8601 format HH:mm.""" + scheduled_stop_time: Optional[str] = rest_field( + name="scheduledStopTime", visibility=["read", "create", "update", "delete", "query"] + ) + """auto stop time. value must be of ISO-8601 format HH:mm.""" + + @overload + def __init__( + self, + *, + day_of_week: "_models.DayOfWeekUpdate", + scheduled_start_time: Optional[str] = None, + scheduled_stop_time: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemData(_Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.oracledatabase.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.oracledatabase.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemVersion(ProxyResource): + """SystemVersion resource Definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.SystemVersionProperties + """ + + properties: Optional["_models.SystemVersionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.SystemVersionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemVersionProperties(_Model): + """System Version Resource model. + + :ivar system_version: A valid Oracle System Version. Required. + :vartype system_version: str + """ + + system_version: str = rest_field(name="systemVersion", visibility=["read", "create", "update", "delete", "query"]) + """A valid Oracle System Version. Required.""" + + @overload + def __init__( + self, + *, + system_version: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VirtualNetworkAddress(ProxyResource): + """Virtual IP resource belonging to a vm cluster resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddressProperties + """ + + properties: Optional["_models.VirtualNetworkAddressProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.VirtualNetworkAddressProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VirtualNetworkAddressProperties(_Model): + """virtualNetworkAddress resource properties. + + :ivar ip_address: Virtual network Address address. + :vartype ip_address: str + :ivar vm_ocid: Virtual Machine OCID. + :vartype vm_ocid: str + :ivar ocid: Application VIP OCID. + :vartype ocid: str + :ivar domain: Virtual network address fully qualified domain name. + :vartype domain: str + :ivar lifecycle_details: Additional information about the current lifecycle state of the + application virtual IP (VIP) address. + :vartype lifecycle_details: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: virtual network address lifecycle state. Known values are: + "Provisioning", "Available", "Terminating", "Terminated", and "Failed". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.VirtualNetworkAddressLifecycleState + :ivar time_assigned: The date and time when the create operation for the application virtual IP + (VIP) address completed. + :vartype time_assigned: ~datetime.datetime + """ + + ip_address: Optional[str] = rest_field(name="ipAddress", visibility=["read", "create"]) + """Virtual network Address address.""" + vm_ocid: Optional[str] = rest_field(name="vmOcid", visibility=["read", "create"]) + """Virtual Machine OCID.""" + ocid: Optional[str] = rest_field(visibility=["read"]) + """Application VIP OCID.""" + domain: Optional[str] = rest_field(visibility=["read"]) + """Virtual network address fully qualified domain name.""" + lifecycle_details: Optional[str] = rest_field(name="lifecycleDetails", visibility=["read"]) + """Additional information about the current lifecycle state of the application virtual IP (VIP) + address.""" + provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Azure resource provisioning state. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + and \"Provisioning\".""" + lifecycle_state: Optional[Union[str, "_models.VirtualNetworkAddressLifecycleState"]] = rest_field( + name="lifecycleState", visibility=["read"] + ) + """virtual network address lifecycle state. Known values are: \"Provisioning\", \"Available\", + \"Terminating\", \"Terminated\", and \"Failed\".""" + time_assigned: Optional[datetime.datetime] = rest_field(name="timeAssigned", visibility=["read"], format="rfc3339") + """The date and time when the create operation for the application virtual IP (VIP) address + completed.""" + + @overload + def __init__( + self, + *, + ip_address: Optional[str] = None, + vm_ocid: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models_py3.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models_py3.py deleted file mode 100644 index b2e79b9f4d18..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models_py3.py +++ /dev/null @@ -1,7339 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union - -from .. import _serialization - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models - - -class ActivationLinks(_serialization.Model): - """Activation Links model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar new_cloud_account_activation_link: New Cloud Account Activation Link. - :vartype new_cloud_account_activation_link: str - :ivar existing_cloud_account_activation_link: Existing Cloud Account Activation Link. - :vartype existing_cloud_account_activation_link: str - """ - - _validation = { - "new_cloud_account_activation_link": {"readonly": True}, - "existing_cloud_account_activation_link": {"readonly": True}, - } - - _attribute_map = { - "new_cloud_account_activation_link": {"key": "newCloudAccountActivationLink", "type": "str"}, - "existing_cloud_account_activation_link": {"key": "existingCloudAccountActivationLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.new_cloud_account_activation_link = None - self.existing_cloud_account_activation_link = None - - -class AddRemoveDbNode(_serialization.Model): - """Add/Remove (Virtual Machine) DbNode model. - - All required parameters must be populated in order to send to server. - - :ivar db_servers: Db servers ocids. Required. - :vartype db_servers: list[str] - """ - - _validation = { - "db_servers": {"required": True}, - } - - _attribute_map = { - "db_servers": {"key": "dbServers", "type": "[str]"}, - } - - def __init__(self, *, db_servers: List[str], **kwargs: Any) -> None: - """ - :keyword db_servers: Db servers ocids. Required. - :paramtype db_servers: list[str] - """ - super().__init__(**kwargs) - self.db_servers = db_servers - - -class AllConnectionStringType(_serialization.Model): - """The connection string profile to allow clients to group, filter and select connection string - values based on structured metadata. - - :ivar high: The High database service provides the highest level of resources to each SQL - statement resulting in the highest performance, but supports the fewest number of concurrent - SQL statements. - :vartype high: str - :ivar low: The Low database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :vartype low: str - :ivar medium: The Medium database service provides a lower level of resources to each SQL - statement potentially resulting a lower level of performance, but supports more concurrent SQL - statements. - :vartype medium: str - """ - - _validation = { - "high": {"max_length": 255, "min_length": 10}, - "low": {"max_length": 255, "min_length": 10}, - "medium": {"max_length": 255, "min_length": 10}, - } - - _attribute_map = { - "high": {"key": "high", "type": "str"}, - "low": {"key": "low", "type": "str"}, - "medium": {"key": "medium", "type": "str"}, - } - - def __init__( - self, *, high: Optional[str] = None, low: Optional[str] = None, medium: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword high: The High database service provides the highest level of resources to each SQL - statement resulting in the highest performance, but supports the fewest number of concurrent - SQL statements. - :paramtype high: str - :keyword low: The Low database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :paramtype low: str - :keyword medium: The Medium database service provides a lower level of resources to each SQL - statement potentially resulting a lower level of performance, but supports more concurrent SQL - statements. - :paramtype medium: str - """ - super().__init__(**kwargs) - self.high = high - self.low = low - self.medium = medium - - -class ApexDetailsType(_serialization.Model): - """Information about Oracle APEX Application Development. - - :ivar apex_version: The Oracle APEX Application Development version. - :vartype apex_version: str - :ivar ords_version: The Oracle REST Data Services (ORDS) version. - :vartype ords_version: str - """ - - _attribute_map = { - "apex_version": {"key": "apexVersion", "type": "str"}, - "ords_version": {"key": "ordsVersion", "type": "str"}, - } - - def __init__( - self, *, apex_version: Optional[str] = None, ords_version: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword apex_version: The Oracle APEX Application Development version. - :paramtype apex_version: str - :keyword ords_version: The Oracle REST Data Services (ORDS) version. - :paramtype ords_version: str - """ - super().__init__(**kwargs) - self.apex_version = apex_version - self.ords_version = ords_version - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class AutonomousDatabase(TrackedResource): - """Autonomous Database resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBaseProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "AutonomousDatabaseBaseProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.AutonomousDatabaseBaseProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBaseProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - """ - - -class AutonomousDatabaseBackup(ProxyResource): - """AutonomousDatabaseBackup resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "AutonomousDatabaseBackupProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.AutonomousDatabaseBackupProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class AutonomousDatabaseBackupListResult(_serialization.Model): - """The response of a AutonomousDatabaseBackup list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The AutonomousDatabaseBackup items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AutonomousDatabaseBackup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.AutonomousDatabaseBackup"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The AutonomousDatabaseBackup items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class AutonomousDatabaseBackupProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """AutonomousDatabaseBackup resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar autonomous_database_ocid: The OCID of the Autonomous Database. - :vartype autonomous_database_ocid: str - :ivar database_size_in_tbs: The size of the database in terabytes at the time the backup was - taken. - :vartype database_size_in_tbs: float - :ivar db_version: A valid Oracle Database version for Autonomous Database. - :vartype db_version: str - :ivar display_name: The user-friendly name for the backup. The name does not have to be unique. - :vartype display_name: str - :ivar ocid: The OCID of the Autonomous Database backup. - :vartype ocid: str - :ivar is_automatic: Indicates whether the backup is user-initiated or automatic. - :vartype is_automatic: bool - :ivar is_restorable: Indicates whether the backup can be used to restore the associated - Autonomous Database. - :vartype is_restorable: bool - :ivar lifecycle_details: Additional information about the current lifecycle state. - :vartype lifecycle_details: str - :ivar lifecycle_state: The current state of the backup. Known values are: "Creating", "Active", - "Deleting", "Failed", and "Updating". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupLifecycleState - :ivar retention_period_in_days: Retention period, in days, for long-term backups. - :vartype retention_period_in_days: int - :ivar size_in_tbs: The backup size in terabytes (TB). - :vartype size_in_tbs: float - :ivar time_available_til: Timestamp until when the backup will be available. - :vartype time_available_til: ~datetime.datetime - :ivar time_started: The date and time the backup started. - :vartype time_started: str - :ivar time_ended: The date and time the backup completed. - :vartype time_ended: str - :ivar backup_type: The type of backup. Known values are: "Incremental", "Full", and "LongTerm". - :vartype backup_type: str or ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupType - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", "Canceled", and "Provisioning". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState - """ - - _validation = { - "autonomous_database_ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "database_size_in_tbs": {"readonly": True}, - "db_version": {"readonly": True}, - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "is_automatic": {"readonly": True}, - "is_restorable": {"readonly": True}, - "lifecycle_details": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "retention_period_in_days": {"maximum": 3650, "minimum": 60}, - "size_in_tbs": {"readonly": True}, - "time_available_til": {"readonly": True}, - "time_started": {"readonly": True}, - "time_ended": {"readonly": True}, - "backup_type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "autonomous_database_ocid": {"key": "autonomousDatabaseOcid", "type": "str"}, - "database_size_in_tbs": {"key": "databaseSizeInTbs", "type": "float"}, - "db_version": {"key": "dbVersion", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "ocid": {"key": "ocid", "type": "str"}, - "is_automatic": {"key": "isAutomatic", "type": "bool"}, - "is_restorable": {"key": "isRestorable", "type": "bool"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "retention_period_in_days": {"key": "retentionPeriodInDays", "type": "int"}, - "size_in_tbs": {"key": "sizeInTbs", "type": "float"}, - "time_available_til": {"key": "timeAvailableTil", "type": "iso-8601"}, - "time_started": {"key": "timeStarted", "type": "str"}, - "time_ended": {"key": "timeEnded", "type": "str"}, - "backup_type": {"key": "backupType", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__( - self, *, display_name: Optional[str] = None, retention_period_in_days: Optional[int] = None, **kwargs: Any - ) -> None: - """ - :keyword display_name: The user-friendly name for the backup. The name does not have to be - unique. - :paramtype display_name: str - :keyword retention_period_in_days: Retention period, in days, for long-term backups. - :paramtype retention_period_in_days: int - """ - super().__init__(**kwargs) - self.autonomous_database_ocid = None - self.database_size_in_tbs = None - self.db_version = None - self.display_name = display_name - self.ocid = None - self.is_automatic = None - self.is_restorable = None - self.lifecycle_details = None - self.lifecycle_state = None - self.retention_period_in_days = retention_period_in_days - self.size_in_tbs = None - self.time_available_til = None - self.time_started = None - self.time_ended = None - self.backup_type = None - self.provisioning_state = None - - -class AutonomousDatabaseBackupUpdate(_serialization.Model): - """The type used for update operations of the AutonomousDatabaseBackup. - - :ivar properties: The updatable properties of the AutonomousDatabaseBackup. - :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdateProperties - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "AutonomousDatabaseBackupUpdateProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.AutonomousDatabaseBackupUpdateProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: The updatable properties of the AutonomousDatabaseBackup. - :paramtype properties: - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdateProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class AutonomousDatabaseBackupUpdateProperties(_serialization.Model): - """The updatable properties of the AutonomousDatabaseBackup. - - :ivar retention_period_in_days: Retention period, in days, for long-term backups. - :vartype retention_period_in_days: int - """ - - _validation = { - "retention_period_in_days": {"maximum": 3650, "minimum": 60}, - } - - _attribute_map = { - "retention_period_in_days": {"key": "retentionPeriodInDays", "type": "int"}, - } - - def __init__(self, *, retention_period_in_days: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword retention_period_in_days: Retention period, in days, for long-term backups. - :paramtype retention_period_in_days: int - """ - super().__init__(**kwargs) - self.retention_period_in_days = retention_period_in_days - - -class AutonomousDatabaseBaseProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Autonomous Database base resource model. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AutonomousDatabaseCloneProperties, AutonomousDatabaseProperties - - 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 admin_password: Admin password. - :vartype admin_password: str - :ivar data_base_type: Database type to be created. Required. Known values are: "Regular" and - "Clone". - :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.DataBaseType - :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous - Database Serverless. Known values are: "Early" and "Regular". - :vartype autonomous_maintenance_schedule_type: str or - ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType - :ivar character_set: The character set for the autonomous database. - :vartype character_set: str - :ivar compute_count: The compute amount (CPUs) available to the database. - :vartype compute_count: float - :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and - "OCPU". - :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel - :ivar cpu_core_count: The number of CPU cores to be made available to the database. - :vartype cpu_core_count: int - :ivar customer_contacts: Customer Contacts. - :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :vartype data_storage_size_in_tbs: int - :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created - and attached to the database. - :vartype data_storage_size_in_gbs: int - :ivar db_version: A valid Oracle Database version for Autonomous Database. - :vartype db_version: str - :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", - "AJD", and "APEX". - :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType - :ivar display_name: The user-friendly name for the Autonomous Database. - :vartype display_name: str - :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database - CPU core count. - :vartype is_auto_scaling_enabled: bool - :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the - Autonomous Database storage. - :vartype is_auto_scaling_for_storage_enabled: bool - :ivar peer_db_ids: The list of `OCIDs - `_ of standby databases - located in Autonomous Data Guard remote regions that are associated with the source database. - Note that for Autonomous Database Serverless instances, standby databases located in the same - region as the source primary database do not have OCIDs. - :vartype peer_db_ids: list[str] - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. - :vartype peer_db_id: str - :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or - called in-region Data Guard enabled. - :vartype is_local_data_guard_enabled: bool - :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region - Data Guard enabled. - :vartype is_remote_data_guard_enabled: bool - :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the - Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business - critical DR with a faster recovery time objective (RTO) during failover or - switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or - switchover. Known values are: "Adg" and "BackupBased". - :vartype local_disaster_recovery_type: str or - ~azure.mgmt.oracledatabase.models.DisasterRecoveryType - :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. - :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary - :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data - Guard failover. - :vartype failed_data_recovery_in_seconds: int - :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS - connections. - :vartype is_mtls_connection_required: bool - :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database - preview version is being provisioned. - :vartype is_preview_version_with_service_terms_accepted: bool - :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. - The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :ivar ncharacter_set: The character set for the Autonomous Database. - :vartype ncharacter_set: str - :ivar lifecycle_details: Additional information about the current lifecycle state. - :vartype lifecycle_details: str - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", "Canceled", and "Provisioning". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState - :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", - "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", - "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", - "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", - "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState - :ivar scheduled_operations: The list of scheduled operations. - :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType - :ivar private_endpoint_ip: The private endpoint Ip address for the resource. - :vartype private_endpoint_ip: str - :ivar private_endpoint_label: The resource's private endpoint label. - :vartype private_endpoint_label: str - :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. - :vartype oci_url: str - :ivar subnet_id: Client subnet. - :vartype subnet_id: str - :ivar vnet_id: VNET for network connectivity. - :vartype vnet_id: str - :ivar time_created: The date and time that the database was created. - :vartype time_created: ~datetime.datetime - :ivar time_maintenance_begin: The date and time when maintenance will begin. - :vartype time_maintenance_begin: ~datetime.datetime - :ivar time_maintenance_end: The date and time when maintenance will end. - :vartype time_maintenance_end: ~datetime.datetime - :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and - system data, in terabytes (TB). - :vartype actual_used_data_storage_size_in_tbs: float - :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database - tables and billed for, rounded up. - :vartype allocated_storage_size_in_tbs: float - :ivar apex_details: Information about Oracle APEX Application Development. - :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType - :ivar available_upgrade_versions: List of Oracle Database versions available for a database - upgrade. If there are no version upgrades available, this list is empty. - :vartype available_upgrade_versions: list[str] - :ivar connection_strings: The connection string used to connect to the Autonomous Database. - :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType - :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL - Developer Web with a browser from a Compute instance within your VCN or that has a direct - connection to your VCN. - :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType - :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. - Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". - :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType - :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. - Known values are: "StandardEdition" and "EnterpriseEdition". - :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType - :ivar autonomous_database_id: Autonomous Database ID. - :vartype autonomous_database_id: str - :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. - :vartype in_memory_area_in_gbs: int - :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would - be created. - :vartype next_long_term_backup_time_stamp: ~datetime.datetime - :ivar long_term_backup_schedule: Details for the long-term backup schedule. - :vartype long_term_backup_schedule: - ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails - :ivar is_preview: Indicates if the Autonomous Database version is a preview version. - :vartype is_preview: bool - :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an - acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered - when necessary for a Local Autonomous Data Guard. - :vartype local_adg_auto_failover_max_data_loss_limit: int - :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or - OCPU. - :vartype memory_per_oracle_compute_unit_in_gbs: int - :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and - "ReadWrite". - :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType - :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. - Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and - "FailedDisabling". - :vartype operations_insights_status: str or - ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType - :ivar permission_level: The Autonomous Database permission level. Known values are: - "Restricted" and "Unrestricted". - :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType - :ivar private_endpoint: The private endpoint for the resource. - :vartype private_endpoint: str - :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. - :vartype provisionable_cpus: list[int] - :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if - Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", - "BackupCopy", and "SnapshotStandby". - :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType - :ivar service_console_url: The URL of the Service Console for the Autonomous Database. - :vartype service_console_url: str - :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. - :vartype sql_web_developer_url: str - :ivar supported_regions_to_clone_to: The list of regions that support the creation of an - Autonomous Database clone or an Autonomous Data Guard standby database. - :vartype supported_regions_to_clone_to: list[str] - :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was - switched for the Autonomous Database. - :vartype time_data_guard_role_changed: str - :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database - will be automatically deleted because of inactivity. - :vartype time_deletion_of_free_autonomous_database: str - :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled - for an Autonomous Database where the standby was provisioned in the same region as the primary - database. - :vartype time_local_data_guard_enabled: str - :ivar time_of_last_failover: The timestamp of the last failover operation. - :vartype time_of_last_failover: str - :ivar time_of_last_refresh: The date and time when last refresh happened. - :vartype time_of_last_refresh: str - :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). - :vartype time_of_last_refresh_point: str - :ivar time_of_last_switchover: The timestamp of the last switchover operation for the - Autonomous Database. - :vartype time_of_last_switchover: str - :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database - will be stopped because of inactivity. - :vartype time_reclamation_of_free_autonomous_database: str - :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. - :vartype used_data_storage_size_in_gbs: int - :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. - :vartype used_data_storage_size_in_tbs: int - :ivar ocid: Database ocid. - :vartype ocid: str - :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. - :vartype backup_retention_period_in_days: int - :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR - notations and/or IP addresses. Values should be separate strings, separated by commas. Example: - ['1.1.1.1','1.1.1.0/24','1.1.2.25']. - :vartype whitelisted_ips: list[str] - """ - - _validation = { - "data_base_type": {"required": True}, - "character_set": {"max_length": 255, "min_length": 1}, - "compute_count": {"maximum": 512, "minimum": 0.1}, - "cpu_core_count": {"maximum": 128, "minimum": 1}, - "data_storage_size_in_tbs": {"maximum": 384, "minimum": 1}, - "data_storage_size_in_gbs": {"maximum": 393216, "minimum": 20}, - "db_version": {"max_length": 255, "min_length": 1}, - "display_name": {"max_length": 255, "min_length": 1}, - "peer_db_ids": {"readonly": True}, - "peer_db_id": {"max_length": 255, "min_length": 1}, - "is_remote_data_guard_enabled": {"readonly": True}, - "local_disaster_recovery_type": {"readonly": True}, - "local_standby_db": {"readonly": True}, - "failed_data_recovery_in_seconds": {"readonly": True}, - "ncharacter_set": {"max_length": 255, "min_length": 1}, - "lifecycle_details": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "oci_url": {"readonly": True}, - "time_created": {"readonly": True}, - "time_maintenance_begin": {"readonly": True}, - "time_maintenance_end": {"readonly": True}, - "actual_used_data_storage_size_in_tbs": {"readonly": True}, - "allocated_storage_size_in_tbs": {"readonly": True}, - "apex_details": {"readonly": True}, - "available_upgrade_versions": {"readonly": True}, - "connection_strings": {"readonly": True}, - "connection_urls": {"readonly": True}, - "data_safe_status": {"readonly": True}, - "in_memory_area_in_gbs": {"readonly": True}, - "next_long_term_backup_time_stamp": {"readonly": True}, - "is_preview": {"readonly": True}, - "local_adg_auto_failover_max_data_loss_limit": {"maximum": 3600, "minimum": 0}, - "memory_per_oracle_compute_unit_in_gbs": {"readonly": True}, - "operations_insights_status": {"readonly": True}, - "private_endpoint": {"readonly": True}, - "provisionable_cpus": {"readonly": True}, - "service_console_url": {"readonly": True, "max_length": 255, "min_length": 10}, - "sql_web_developer_url": {"readonly": True, "max_length": 2048, "min_length": 10}, - "supported_regions_to_clone_to": {"readonly": True, "max_items": 50, "min_items": 0}, - "time_data_guard_role_changed": {"readonly": True}, - "time_deletion_of_free_autonomous_database": {"readonly": True}, - "time_local_data_guard_enabled": {"readonly": True}, - "time_of_last_failover": {"readonly": True}, - "time_of_last_refresh": {"readonly": True}, - "time_of_last_refresh_point": {"readonly": True}, - "time_of_last_switchover": {"readonly": True}, - "time_reclamation_of_free_autonomous_database": {"readonly": True}, - "used_data_storage_size_in_gbs": {"readonly": True}, - "used_data_storage_size_in_tbs": {"readonly": True}, - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "admin_password": {"key": "adminPassword", "type": "str"}, - "data_base_type": {"key": "dataBaseType", "type": "str"}, - "autonomous_maintenance_schedule_type": {"key": "autonomousMaintenanceScheduleType", "type": "str"}, - "character_set": {"key": "characterSet", "type": "str"}, - "compute_count": {"key": "computeCount", "type": "float"}, - "compute_model": {"key": "computeModel", "type": "str"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "int"}, - "data_storage_size_in_gbs": {"key": "dataStorageSizeInGbs", "type": "int"}, - "db_version": {"key": "dbVersion", "type": "str"}, - "db_workload": {"key": "dbWorkload", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "is_auto_scaling_enabled": {"key": "isAutoScalingEnabled", "type": "bool"}, - "is_auto_scaling_for_storage_enabled": {"key": "isAutoScalingForStorageEnabled", "type": "bool"}, - "peer_db_ids": {"key": "peerDbIds", "type": "[str]"}, - "peer_db_id": {"key": "peerDbId", "type": "str"}, - "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, - "is_remote_data_guard_enabled": {"key": "isRemoteDataGuardEnabled", "type": "bool"}, - "local_disaster_recovery_type": {"key": "localDisasterRecoveryType", "type": "str"}, - "local_standby_db": {"key": "localStandbyDb", "type": "AutonomousDatabaseStandbySummary"}, - "failed_data_recovery_in_seconds": {"key": "failedDataRecoveryInSeconds", "type": "int"}, - "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, - "is_preview_version_with_service_terms_accepted": { - "key": "isPreviewVersionWithServiceTermsAccepted", - "type": "bool", - }, - "license_model": {"key": "licenseModel", "type": "str"}, - "ncharacter_set": {"key": "ncharacterSet", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "scheduled_operations": {"key": "scheduledOperations", "type": "ScheduledOperationsType"}, - "private_endpoint_ip": {"key": "privateEndpointIp", "type": "str"}, - "private_endpoint_label": {"key": "privateEndpointLabel", "type": "str"}, - "oci_url": {"key": "ociUrl", "type": "str"}, - "subnet_id": {"key": "subnetId", "type": "str"}, - "vnet_id": {"key": "vnetId", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "time_maintenance_begin": {"key": "timeMaintenanceBegin", "type": "iso-8601"}, - "time_maintenance_end": {"key": "timeMaintenanceEnd", "type": "iso-8601"}, - "actual_used_data_storage_size_in_tbs": {"key": "actualUsedDataStorageSizeInTbs", "type": "float"}, - "allocated_storage_size_in_tbs": {"key": "allocatedStorageSizeInTbs", "type": "float"}, - "apex_details": {"key": "apexDetails", "type": "ApexDetailsType"}, - "available_upgrade_versions": {"key": "availableUpgradeVersions", "type": "[str]"}, - "connection_strings": {"key": "connectionStrings", "type": "ConnectionStringType"}, - "connection_urls": {"key": "connectionUrls", "type": "ConnectionUrlType"}, - "data_safe_status": {"key": "dataSafeStatus", "type": "str"}, - "database_edition": {"key": "databaseEdition", "type": "str"}, - "autonomous_database_id": {"key": "autonomousDatabaseId", "type": "str"}, - "in_memory_area_in_gbs": {"key": "inMemoryAreaInGbs", "type": "int"}, - "next_long_term_backup_time_stamp": {"key": "nextLongTermBackupTimeStamp", "type": "iso-8601"}, - "long_term_backup_schedule": {"key": "longTermBackupSchedule", "type": "LongTermBackUpScheduleDetails"}, - "is_preview": {"key": "isPreview", "type": "bool"}, - "local_adg_auto_failover_max_data_loss_limit": {"key": "localAdgAutoFailoverMaxDataLossLimit", "type": "int"}, - "memory_per_oracle_compute_unit_in_gbs": {"key": "memoryPerOracleComputeUnitInGbs", "type": "int"}, - "open_mode": {"key": "openMode", "type": "str"}, - "operations_insights_status": {"key": "operationsInsightsStatus", "type": "str"}, - "permission_level": {"key": "permissionLevel", "type": "str"}, - "private_endpoint": {"key": "privateEndpoint", "type": "str"}, - "provisionable_cpus": {"key": "provisionableCpus", "type": "[int]"}, - "role": {"key": "role", "type": "str"}, - "service_console_url": {"key": "serviceConsoleUrl", "type": "str"}, - "sql_web_developer_url": {"key": "sqlWebDeveloperUrl", "type": "str"}, - "supported_regions_to_clone_to": {"key": "supportedRegionsToCloneTo", "type": "[str]"}, - "time_data_guard_role_changed": {"key": "timeDataGuardRoleChanged", "type": "str"}, - "time_deletion_of_free_autonomous_database": {"key": "timeDeletionOfFreeAutonomousDatabase", "type": "str"}, - "time_local_data_guard_enabled": {"key": "timeLocalDataGuardEnabled", "type": "str"}, - "time_of_last_failover": {"key": "timeOfLastFailover", "type": "str"}, - "time_of_last_refresh": {"key": "timeOfLastRefresh", "type": "str"}, - "time_of_last_refresh_point": {"key": "timeOfLastRefreshPoint", "type": "str"}, - "time_of_last_switchover": {"key": "timeOfLastSwitchover", "type": "str"}, - "time_reclamation_of_free_autonomous_database": { - "key": "timeReclamationOfFreeAutonomousDatabase", - "type": "str", - }, - "used_data_storage_size_in_gbs": {"key": "usedDataStorageSizeInGbs", "type": "int"}, - "used_data_storage_size_in_tbs": {"key": "usedDataStorageSizeInTbs", "type": "int"}, - "ocid": {"key": "ocid", "type": "str"}, - "backup_retention_period_in_days": {"key": "backupRetentionPeriodInDays", "type": "int"}, - "whitelisted_ips": {"key": "whitelistedIps", "type": "[str]"}, - } - - _subtype_map = { - "data_base_type": {"Clone": "AutonomousDatabaseCloneProperties", "Regular": "AutonomousDatabaseProperties"} - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - admin_password: Optional[str] = None, - autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, - character_set: Optional[str] = None, - compute_count: Optional[float] = None, - compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, - cpu_core_count: Optional[int] = None, - customer_contacts: Optional[List["_models.CustomerContact"]] = None, - data_storage_size_in_tbs: Optional[int] = None, - data_storage_size_in_gbs: Optional[int] = None, - db_version: Optional[str] = None, - db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, - display_name: Optional[str] = None, - is_auto_scaling_enabled: Optional[bool] = None, - is_auto_scaling_for_storage_enabled: Optional[bool] = None, - peer_db_id: Optional[str] = None, - is_local_data_guard_enabled: Optional[bool] = None, - is_mtls_connection_required: Optional[bool] = None, - is_preview_version_with_service_terms_accepted: Optional[bool] = None, - license_model: Optional[Union[str, "_models.LicenseModel"]] = None, - ncharacter_set: Optional[str] = None, - scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, - private_endpoint_ip: Optional[str] = None, - private_endpoint_label: Optional[str] = None, - subnet_id: Optional[str] = None, - vnet_id: Optional[str] = None, - database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, - autonomous_database_id: Optional[str] = None, - long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, - local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, - open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, - permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, - role: Optional[Union[str, "_models.RoleType"]] = None, - backup_retention_period_in_days: Optional[int] = None, - whitelisted_ips: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword admin_password: Admin password. - :paramtype admin_password: str - :keyword autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous - Database Serverless. Known values are: "Early" and "Regular". - :paramtype autonomous_maintenance_schedule_type: str or - ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType - :keyword character_set: The character set for the autonomous database. - :paramtype character_set: str - :keyword compute_count: The compute amount (CPUs) available to the database. - :paramtype compute_count: float - :keyword compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" - and "OCPU". - :paramtype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel - :keyword cpu_core_count: The number of CPU cores to be made available to the database. - :paramtype cpu_core_count: int - :keyword customer_contacts: Customer Contacts. - :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :keyword data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :paramtype data_storage_size_in_tbs: int - :keyword data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be - created and attached to the database. - :paramtype data_storage_size_in_gbs: int - :keyword db_version: A valid Oracle Database version for Autonomous Database. - :paramtype db_version: str - :keyword db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", - "AJD", and "APEX". - :paramtype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType - :keyword display_name: The user-friendly name for the Autonomous Database. - :paramtype display_name: str - :keyword is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous - Database CPU core count. - :paramtype is_auto_scaling_enabled: bool - :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the - Autonomous Database storage. - :paramtype is_auto_scaling_for_storage_enabled: bool - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. - :paramtype peer_db_id: str - :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or - called in-region Data Guard enabled. - :paramtype is_local_data_guard_enabled: bool - :keyword is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS - connections. - :paramtype is_mtls_connection_required: bool - :keyword is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database - preview version is being provisioned. - :paramtype is_preview_version_with_service_terms_accepted: bool - :keyword license_model: The Oracle license model that applies to the Oracle Autonomous - Database. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and - "BringYourOwnLicense". - :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :keyword ncharacter_set: The character set for the Autonomous Database. - :paramtype ncharacter_set: str - :keyword scheduled_operations: The list of scheduled operations. - :paramtype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType - :keyword private_endpoint_ip: The private endpoint Ip address for the resource. - :paramtype private_endpoint_ip: str - :keyword private_endpoint_label: The resource's private endpoint label. - :paramtype private_endpoint_label: str - :keyword subnet_id: Client subnet. - :paramtype subnet_id: str - :keyword vnet_id: VNET for network connectivity. - :paramtype vnet_id: str - :keyword database_edition: The Oracle Database Edition that applies to the Autonomous - databases. Known values are: "StandardEdition" and "EnterpriseEdition". - :paramtype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType - :keyword autonomous_database_id: Autonomous Database ID. - :paramtype autonomous_database_id: str - :keyword long_term_backup_schedule: Details for the long-term backup schedule. - :paramtype long_term_backup_schedule: - ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails - :keyword local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an - acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered - when necessary for a Local Autonomous Data Guard. - :paramtype local_adg_auto_failover_max_data_loss_limit: int - :keyword open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and - "ReadWrite". - :paramtype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType - :keyword permission_level: The Autonomous Database permission level. Known values are: - "Restricted" and "Unrestricted". - :paramtype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType - :keyword role: The Data Guard role of the Autonomous Container Database or Autonomous Database, - if Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", - "BackupCopy", and "SnapshotStandby". - :paramtype role: str or ~azure.mgmt.oracledatabase.models.RoleType - :keyword backup_retention_period_in_days: Retention period, in days, for long-term backups. - :paramtype backup_retention_period_in_days: int - :keyword whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR - notations and/or IP addresses. Values should be separate strings, separated by commas. Example: - ['1.1.1.1','1.1.1.0/24','1.1.2.25']. - :paramtype whitelisted_ips: list[str] - """ - super().__init__(**kwargs) - self.admin_password = admin_password - self.data_base_type: Optional[str] = None - self.autonomous_maintenance_schedule_type = autonomous_maintenance_schedule_type - self.character_set = character_set - self.compute_count = compute_count - self.compute_model = compute_model - self.cpu_core_count = cpu_core_count - self.customer_contacts = customer_contacts - self.data_storage_size_in_tbs = data_storage_size_in_tbs - self.data_storage_size_in_gbs = data_storage_size_in_gbs - self.db_version = db_version - self.db_workload = db_workload - self.display_name = display_name - self.is_auto_scaling_enabled = is_auto_scaling_enabled - self.is_auto_scaling_for_storage_enabled = is_auto_scaling_for_storage_enabled - self.peer_db_ids = None - self.peer_db_id = peer_db_id - self.is_local_data_guard_enabled = is_local_data_guard_enabled - self.is_remote_data_guard_enabled = None - self.local_disaster_recovery_type = None - self.local_standby_db = None - self.failed_data_recovery_in_seconds = None - self.is_mtls_connection_required = is_mtls_connection_required - self.is_preview_version_with_service_terms_accepted = is_preview_version_with_service_terms_accepted - self.license_model = license_model - self.ncharacter_set = ncharacter_set - self.lifecycle_details = None - self.provisioning_state = None - self.lifecycle_state = None - self.scheduled_operations = scheduled_operations - self.private_endpoint_ip = private_endpoint_ip - self.private_endpoint_label = private_endpoint_label - self.oci_url = None - self.subnet_id = subnet_id - self.vnet_id = vnet_id - self.time_created = None - self.time_maintenance_begin = None - self.time_maintenance_end = None - self.actual_used_data_storage_size_in_tbs = None - self.allocated_storage_size_in_tbs = None - self.apex_details = None - self.available_upgrade_versions = None - self.connection_strings = None - self.connection_urls = None - self.data_safe_status = None - self.database_edition = database_edition - self.autonomous_database_id = autonomous_database_id - self.in_memory_area_in_gbs = None - self.next_long_term_backup_time_stamp = None - self.long_term_backup_schedule = long_term_backup_schedule - self.is_preview = None - self.local_adg_auto_failover_max_data_loss_limit = local_adg_auto_failover_max_data_loss_limit - self.memory_per_oracle_compute_unit_in_gbs = None - self.open_mode = open_mode - self.operations_insights_status = None - self.permission_level = permission_level - self.private_endpoint = None - self.provisionable_cpus = None - self.role = role - self.service_console_url = None - self.sql_web_developer_url = None - self.supported_regions_to_clone_to = None - self.time_data_guard_role_changed = None - self.time_deletion_of_free_autonomous_database = None - self.time_local_data_guard_enabled = None - self.time_of_last_failover = None - self.time_of_last_refresh = None - self.time_of_last_refresh_point = None - self.time_of_last_switchover = None - self.time_reclamation_of_free_autonomous_database = None - self.used_data_storage_size_in_gbs = None - self.used_data_storage_size_in_tbs = None - self.ocid = None - self.backup_retention_period_in_days = backup_retention_period_in_days - self.whitelisted_ips = whitelisted_ips - - -class AutonomousDatabaseCharacterSet(ProxyResource): - """AutonomousDatabaseCharacterSets resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSetProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "AutonomousDatabaseCharacterSetProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.AutonomousDatabaseCharacterSetProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSetProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class AutonomousDatabaseCharacterSetListResult(_serialization.Model): - """The response of a AutonomousDatabaseCharacterSet list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The AutonomousDatabaseCharacterSet items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AutonomousDatabaseCharacterSet]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.AutonomousDatabaseCharacterSet"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The AutonomousDatabaseCharacterSet items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class AutonomousDatabaseCharacterSetProperties(_serialization.Model): - """AutonomousDatabaseCharacterSet resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar character_set: The Oracle Autonomous Database supported character sets. Required. - :vartype character_set: str - """ - - _validation = { - "character_set": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "character_set": {"key": "characterSet", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.character_set = None - - -class AutonomousDatabaseCloneProperties( - AutonomousDatabaseBaseProperties -): # pylint: disable=too-many-instance-attributes - """Autonomous Database clone resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar admin_password: Admin password. - :vartype admin_password: str - :ivar data_base_type: Database type to be created. Required. Known values are: "Regular" and - "Clone". - :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.DataBaseType - :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous - Database Serverless. Known values are: "Early" and "Regular". - :vartype autonomous_maintenance_schedule_type: str or - ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType - :ivar character_set: The character set for the autonomous database. - :vartype character_set: str - :ivar compute_count: The compute amount (CPUs) available to the database. - :vartype compute_count: float - :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and - "OCPU". - :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel - :ivar cpu_core_count: The number of CPU cores to be made available to the database. - :vartype cpu_core_count: int - :ivar customer_contacts: Customer Contacts. - :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :vartype data_storage_size_in_tbs: int - :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created - and attached to the database. - :vartype data_storage_size_in_gbs: int - :ivar db_version: A valid Oracle Database version for Autonomous Database. - :vartype db_version: str - :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", - "AJD", and "APEX". - :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType - :ivar display_name: The user-friendly name for the Autonomous Database. - :vartype display_name: str - :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database - CPU core count. - :vartype is_auto_scaling_enabled: bool - :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the - Autonomous Database storage. - :vartype is_auto_scaling_for_storage_enabled: bool - :ivar peer_db_ids: The list of `OCIDs - `_ of standby databases - located in Autonomous Data Guard remote regions that are associated with the source database. - Note that for Autonomous Database Serverless instances, standby databases located in the same - region as the source primary database do not have OCIDs. - :vartype peer_db_ids: list[str] - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. - :vartype peer_db_id: str - :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or - called in-region Data Guard enabled. - :vartype is_local_data_guard_enabled: bool - :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region - Data Guard enabled. - :vartype is_remote_data_guard_enabled: bool - :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the - Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business - critical DR with a faster recovery time objective (RTO) during failover or - switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or - switchover. Known values are: "Adg" and "BackupBased". - :vartype local_disaster_recovery_type: str or - ~azure.mgmt.oracledatabase.models.DisasterRecoveryType - :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. - :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary - :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data - Guard failover. - :vartype failed_data_recovery_in_seconds: int - :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS - connections. - :vartype is_mtls_connection_required: bool - :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database - preview version is being provisioned. - :vartype is_preview_version_with_service_terms_accepted: bool - :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. - The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :ivar ncharacter_set: The character set for the Autonomous Database. - :vartype ncharacter_set: str - :ivar lifecycle_details: Additional information about the current lifecycle state. - :vartype lifecycle_details: str - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", "Canceled", and "Provisioning". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState - :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", - "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", - "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", - "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", - "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState - :ivar scheduled_operations: The list of scheduled operations. - :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType - :ivar private_endpoint_ip: The private endpoint Ip address for the resource. - :vartype private_endpoint_ip: str - :ivar private_endpoint_label: The resource's private endpoint label. - :vartype private_endpoint_label: str - :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. - :vartype oci_url: str - :ivar subnet_id: Client subnet. - :vartype subnet_id: str - :ivar vnet_id: VNET for network connectivity. - :vartype vnet_id: str - :ivar time_created: The date and time that the database was created. - :vartype time_created: ~datetime.datetime - :ivar time_maintenance_begin: The date and time when maintenance will begin. - :vartype time_maintenance_begin: ~datetime.datetime - :ivar time_maintenance_end: The date and time when maintenance will end. - :vartype time_maintenance_end: ~datetime.datetime - :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and - system data, in terabytes (TB). - :vartype actual_used_data_storage_size_in_tbs: float - :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database - tables and billed for, rounded up. - :vartype allocated_storage_size_in_tbs: float - :ivar apex_details: Information about Oracle APEX Application Development. - :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType - :ivar available_upgrade_versions: List of Oracle Database versions available for a database - upgrade. If there are no version upgrades available, this list is empty. - :vartype available_upgrade_versions: list[str] - :ivar connection_strings: The connection string used to connect to the Autonomous Database. - :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType - :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL - Developer Web with a browser from a Compute instance within your VCN or that has a direct - connection to your VCN. - :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType - :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. - Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". - :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType - :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. - Known values are: "StandardEdition" and "EnterpriseEdition". - :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType - :ivar autonomous_database_id: Autonomous Database ID. - :vartype autonomous_database_id: str - :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. - :vartype in_memory_area_in_gbs: int - :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would - be created. - :vartype next_long_term_backup_time_stamp: ~datetime.datetime - :ivar long_term_backup_schedule: Details for the long-term backup schedule. - :vartype long_term_backup_schedule: - ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails - :ivar is_preview: Indicates if the Autonomous Database version is a preview version. - :vartype is_preview: bool - :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an - acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered - when necessary for a Local Autonomous Data Guard. - :vartype local_adg_auto_failover_max_data_loss_limit: int - :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or - OCPU. - :vartype memory_per_oracle_compute_unit_in_gbs: int - :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and - "ReadWrite". - :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType - :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. - Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and - "FailedDisabling". - :vartype operations_insights_status: str or - ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType - :ivar permission_level: The Autonomous Database permission level. Known values are: - "Restricted" and "Unrestricted". - :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType - :ivar private_endpoint: The private endpoint for the resource. - :vartype private_endpoint: str - :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. - :vartype provisionable_cpus: list[int] - :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if - Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", - "BackupCopy", and "SnapshotStandby". - :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType - :ivar service_console_url: The URL of the Service Console for the Autonomous Database. - :vartype service_console_url: str - :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. - :vartype sql_web_developer_url: str - :ivar supported_regions_to_clone_to: The list of regions that support the creation of an - Autonomous Database clone or an Autonomous Data Guard standby database. - :vartype supported_regions_to_clone_to: list[str] - :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was - switched for the Autonomous Database. - :vartype time_data_guard_role_changed: str - :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database - will be automatically deleted because of inactivity. - :vartype time_deletion_of_free_autonomous_database: str - :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled - for an Autonomous Database where the standby was provisioned in the same region as the primary - database. - :vartype time_local_data_guard_enabled: str - :ivar time_of_last_failover: The timestamp of the last failover operation. - :vartype time_of_last_failover: str - :ivar time_of_last_refresh: The date and time when last refresh happened. - :vartype time_of_last_refresh: str - :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). - :vartype time_of_last_refresh_point: str - :ivar time_of_last_switchover: The timestamp of the last switchover operation for the - Autonomous Database. - :vartype time_of_last_switchover: str - :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database - will be stopped because of inactivity. - :vartype time_reclamation_of_free_autonomous_database: str - :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. - :vartype used_data_storage_size_in_gbs: int - :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. - :vartype used_data_storage_size_in_tbs: int - :ivar ocid: Database ocid. - :vartype ocid: str - :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. - :vartype backup_retention_period_in_days: int - :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR - notations and/or IP addresses. Values should be separate strings, separated by commas. Example: - ['1.1.1.1','1.1.1.0/24','1.1.2.25']. - :vartype whitelisted_ips: list[str] - :ivar source: The source of the database. Known values are: "None", "Database", "BackupFromId", - "BackupFromTimestamp", "CloneToRefreshable", "CrossRegionDataguard", and - "CrossRegionDisasterRecovery". - :vartype source: str or ~azure.mgmt.oracledatabase.models.SourceType - :ivar source_id: The Azure ID of the Autonomous Database that was cloned to create the current - Autonomous Database. Required. - :vartype source_id: str - :ivar clone_type: The Autonomous Database clone type. Required. Known values are: "Full" and - "Metadata". - :vartype clone_type: str or ~azure.mgmt.oracledatabase.models.CloneType - :ivar is_reconnect_clone_enabled: Indicates if the refreshable clone can be reconnected to its - source database. - :vartype is_reconnect_clone_enabled: bool - :ivar is_refreshable_clone: Indicates if the Autonomous Database is a refreshable clone. - :vartype is_refreshable_clone: bool - :ivar refreshable_model: The refresh mode of the clone. Known values are: "Automatic" and - "Manual". - :vartype refreshable_model: str or ~azure.mgmt.oracledatabase.models.RefreshableModelType - :ivar refreshable_status: The refresh status of the clone. Known values are: "Refreshing" and - "NotRefreshing". - :vartype refreshable_status: str or ~azure.mgmt.oracledatabase.models.RefreshableStatusType - :ivar time_until_reconnect_clone_enabled: The time and date as an RFC3339 formatted string, - e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to - its source database. - :vartype time_until_reconnect_clone_enabled: str - """ - - _validation = { - "data_base_type": {"required": True}, - "character_set": {"max_length": 255, "min_length": 1}, - "compute_count": {"maximum": 512, "minimum": 0.1}, - "cpu_core_count": {"maximum": 128, "minimum": 1}, - "data_storage_size_in_tbs": {"maximum": 384, "minimum": 1}, - "data_storage_size_in_gbs": {"maximum": 393216, "minimum": 20}, - "db_version": {"max_length": 255, "min_length": 1}, - "display_name": {"max_length": 255, "min_length": 1}, - "peer_db_ids": {"readonly": True}, - "peer_db_id": {"max_length": 255, "min_length": 1}, - "is_remote_data_guard_enabled": {"readonly": True}, - "local_disaster_recovery_type": {"readonly": True}, - "local_standby_db": {"readonly": True}, - "failed_data_recovery_in_seconds": {"readonly": True}, - "ncharacter_set": {"max_length": 255, "min_length": 1}, - "lifecycle_details": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "oci_url": {"readonly": True}, - "time_created": {"readonly": True}, - "time_maintenance_begin": {"readonly": True}, - "time_maintenance_end": {"readonly": True}, - "actual_used_data_storage_size_in_tbs": {"readonly": True}, - "allocated_storage_size_in_tbs": {"readonly": True}, - "apex_details": {"readonly": True}, - "available_upgrade_versions": {"readonly": True}, - "connection_strings": {"readonly": True}, - "connection_urls": {"readonly": True}, - "data_safe_status": {"readonly": True}, - "in_memory_area_in_gbs": {"readonly": True}, - "next_long_term_backup_time_stamp": {"readonly": True}, - "is_preview": {"readonly": True}, - "local_adg_auto_failover_max_data_loss_limit": {"maximum": 3600, "minimum": 0}, - "memory_per_oracle_compute_unit_in_gbs": {"readonly": True}, - "operations_insights_status": {"readonly": True}, - "private_endpoint": {"readonly": True}, - "provisionable_cpus": {"readonly": True}, - "service_console_url": {"readonly": True, "max_length": 255, "min_length": 10}, - "sql_web_developer_url": {"readonly": True, "max_length": 2048, "min_length": 10}, - "supported_regions_to_clone_to": {"readonly": True, "max_items": 50, "min_items": 0}, - "time_data_guard_role_changed": {"readonly": True}, - "time_deletion_of_free_autonomous_database": {"readonly": True}, - "time_local_data_guard_enabled": {"readonly": True}, - "time_of_last_failover": {"readonly": True}, - "time_of_last_refresh": {"readonly": True}, - "time_of_last_refresh_point": {"readonly": True}, - "time_of_last_switchover": {"readonly": True}, - "time_reclamation_of_free_autonomous_database": {"readonly": True}, - "used_data_storage_size_in_gbs": {"readonly": True}, - "used_data_storage_size_in_tbs": {"readonly": True}, - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "source_id": {"required": True}, - "clone_type": {"required": True}, - "is_reconnect_clone_enabled": {"readonly": True}, - "is_refreshable_clone": {"readonly": True}, - "refreshable_status": {"readonly": True}, - } - - _attribute_map = { - "admin_password": {"key": "adminPassword", "type": "str"}, - "data_base_type": {"key": "dataBaseType", "type": "str"}, - "autonomous_maintenance_schedule_type": {"key": "autonomousMaintenanceScheduleType", "type": "str"}, - "character_set": {"key": "characterSet", "type": "str"}, - "compute_count": {"key": "computeCount", "type": "float"}, - "compute_model": {"key": "computeModel", "type": "str"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "int"}, - "data_storage_size_in_gbs": {"key": "dataStorageSizeInGbs", "type": "int"}, - "db_version": {"key": "dbVersion", "type": "str"}, - "db_workload": {"key": "dbWorkload", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "is_auto_scaling_enabled": {"key": "isAutoScalingEnabled", "type": "bool"}, - "is_auto_scaling_for_storage_enabled": {"key": "isAutoScalingForStorageEnabled", "type": "bool"}, - "peer_db_ids": {"key": "peerDbIds", "type": "[str]"}, - "peer_db_id": {"key": "peerDbId", "type": "str"}, - "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, - "is_remote_data_guard_enabled": {"key": "isRemoteDataGuardEnabled", "type": "bool"}, - "local_disaster_recovery_type": {"key": "localDisasterRecoveryType", "type": "str"}, - "local_standby_db": {"key": "localStandbyDb", "type": "AutonomousDatabaseStandbySummary"}, - "failed_data_recovery_in_seconds": {"key": "failedDataRecoveryInSeconds", "type": "int"}, - "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, - "is_preview_version_with_service_terms_accepted": { - "key": "isPreviewVersionWithServiceTermsAccepted", - "type": "bool", - }, - "license_model": {"key": "licenseModel", "type": "str"}, - "ncharacter_set": {"key": "ncharacterSet", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "scheduled_operations": {"key": "scheduledOperations", "type": "ScheduledOperationsType"}, - "private_endpoint_ip": {"key": "privateEndpointIp", "type": "str"}, - "private_endpoint_label": {"key": "privateEndpointLabel", "type": "str"}, - "oci_url": {"key": "ociUrl", "type": "str"}, - "subnet_id": {"key": "subnetId", "type": "str"}, - "vnet_id": {"key": "vnetId", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "time_maintenance_begin": {"key": "timeMaintenanceBegin", "type": "iso-8601"}, - "time_maintenance_end": {"key": "timeMaintenanceEnd", "type": "iso-8601"}, - "actual_used_data_storage_size_in_tbs": {"key": "actualUsedDataStorageSizeInTbs", "type": "float"}, - "allocated_storage_size_in_tbs": {"key": "allocatedStorageSizeInTbs", "type": "float"}, - "apex_details": {"key": "apexDetails", "type": "ApexDetailsType"}, - "available_upgrade_versions": {"key": "availableUpgradeVersions", "type": "[str]"}, - "connection_strings": {"key": "connectionStrings", "type": "ConnectionStringType"}, - "connection_urls": {"key": "connectionUrls", "type": "ConnectionUrlType"}, - "data_safe_status": {"key": "dataSafeStatus", "type": "str"}, - "database_edition": {"key": "databaseEdition", "type": "str"}, - "autonomous_database_id": {"key": "autonomousDatabaseId", "type": "str"}, - "in_memory_area_in_gbs": {"key": "inMemoryAreaInGbs", "type": "int"}, - "next_long_term_backup_time_stamp": {"key": "nextLongTermBackupTimeStamp", "type": "iso-8601"}, - "long_term_backup_schedule": {"key": "longTermBackupSchedule", "type": "LongTermBackUpScheduleDetails"}, - "is_preview": {"key": "isPreview", "type": "bool"}, - "local_adg_auto_failover_max_data_loss_limit": {"key": "localAdgAutoFailoverMaxDataLossLimit", "type": "int"}, - "memory_per_oracle_compute_unit_in_gbs": {"key": "memoryPerOracleComputeUnitInGbs", "type": "int"}, - "open_mode": {"key": "openMode", "type": "str"}, - "operations_insights_status": {"key": "operationsInsightsStatus", "type": "str"}, - "permission_level": {"key": "permissionLevel", "type": "str"}, - "private_endpoint": {"key": "privateEndpoint", "type": "str"}, - "provisionable_cpus": {"key": "provisionableCpus", "type": "[int]"}, - "role": {"key": "role", "type": "str"}, - "service_console_url": {"key": "serviceConsoleUrl", "type": "str"}, - "sql_web_developer_url": {"key": "sqlWebDeveloperUrl", "type": "str"}, - "supported_regions_to_clone_to": {"key": "supportedRegionsToCloneTo", "type": "[str]"}, - "time_data_guard_role_changed": {"key": "timeDataGuardRoleChanged", "type": "str"}, - "time_deletion_of_free_autonomous_database": {"key": "timeDeletionOfFreeAutonomousDatabase", "type": "str"}, - "time_local_data_guard_enabled": {"key": "timeLocalDataGuardEnabled", "type": "str"}, - "time_of_last_failover": {"key": "timeOfLastFailover", "type": "str"}, - "time_of_last_refresh": {"key": "timeOfLastRefresh", "type": "str"}, - "time_of_last_refresh_point": {"key": "timeOfLastRefreshPoint", "type": "str"}, - "time_of_last_switchover": {"key": "timeOfLastSwitchover", "type": "str"}, - "time_reclamation_of_free_autonomous_database": { - "key": "timeReclamationOfFreeAutonomousDatabase", - "type": "str", - }, - "used_data_storage_size_in_gbs": {"key": "usedDataStorageSizeInGbs", "type": "int"}, - "used_data_storage_size_in_tbs": {"key": "usedDataStorageSizeInTbs", "type": "int"}, - "ocid": {"key": "ocid", "type": "str"}, - "backup_retention_period_in_days": {"key": "backupRetentionPeriodInDays", "type": "int"}, - "whitelisted_ips": {"key": "whitelistedIps", "type": "[str]"}, - "source": {"key": "source", "type": "str"}, - "source_id": {"key": "sourceId", "type": "str"}, - "clone_type": {"key": "cloneType", "type": "str"}, - "is_reconnect_clone_enabled": {"key": "isReconnectCloneEnabled", "type": "bool"}, - "is_refreshable_clone": {"key": "isRefreshableClone", "type": "bool"}, - "refreshable_model": {"key": "refreshableModel", "type": "str"}, - "refreshable_status": {"key": "refreshableStatus", "type": "str"}, - "time_until_reconnect_clone_enabled": {"key": "timeUntilReconnectCloneEnabled", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - source_id: str, - clone_type: Union[str, "_models.CloneType"], - admin_password: Optional[str] = None, - autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, - character_set: Optional[str] = None, - compute_count: Optional[float] = None, - compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, - cpu_core_count: Optional[int] = None, - customer_contacts: Optional[List["_models.CustomerContact"]] = None, - data_storage_size_in_tbs: Optional[int] = None, - data_storage_size_in_gbs: Optional[int] = None, - db_version: Optional[str] = None, - db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, - display_name: Optional[str] = None, - is_auto_scaling_enabled: Optional[bool] = None, - is_auto_scaling_for_storage_enabled: Optional[bool] = None, - peer_db_id: Optional[str] = None, - is_local_data_guard_enabled: Optional[bool] = None, - is_mtls_connection_required: Optional[bool] = None, - is_preview_version_with_service_terms_accepted: Optional[bool] = None, - license_model: Optional[Union[str, "_models.LicenseModel"]] = None, - ncharacter_set: Optional[str] = None, - scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, - private_endpoint_ip: Optional[str] = None, - private_endpoint_label: Optional[str] = None, - subnet_id: Optional[str] = None, - vnet_id: Optional[str] = None, - database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, - autonomous_database_id: Optional[str] = None, - long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, - local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, - open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, - permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, - role: Optional[Union[str, "_models.RoleType"]] = None, - backup_retention_period_in_days: Optional[int] = None, - whitelisted_ips: Optional[List[str]] = None, - source: Optional[Union[str, "_models.SourceType"]] = None, - refreshable_model: Optional[Union[str, "_models.RefreshableModelType"]] = None, - time_until_reconnect_clone_enabled: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword admin_password: Admin password. - :paramtype admin_password: str - :keyword autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous - Database Serverless. Known values are: "Early" and "Regular". - :paramtype autonomous_maintenance_schedule_type: str or - ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType - :keyword character_set: The character set for the autonomous database. - :paramtype character_set: str - :keyword compute_count: The compute amount (CPUs) available to the database. - :paramtype compute_count: float - :keyword compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" - and "OCPU". - :paramtype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel - :keyword cpu_core_count: The number of CPU cores to be made available to the database. - :paramtype cpu_core_count: int - :keyword customer_contacts: Customer Contacts. - :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :keyword data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :paramtype data_storage_size_in_tbs: int - :keyword data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be - created and attached to the database. - :paramtype data_storage_size_in_gbs: int - :keyword db_version: A valid Oracle Database version for Autonomous Database. - :paramtype db_version: str - :keyword db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", - "AJD", and "APEX". - :paramtype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType - :keyword display_name: The user-friendly name for the Autonomous Database. - :paramtype display_name: str - :keyword is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous - Database CPU core count. - :paramtype is_auto_scaling_enabled: bool - :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the - Autonomous Database storage. - :paramtype is_auto_scaling_for_storage_enabled: bool - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. - :paramtype peer_db_id: str - :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or - called in-region Data Guard enabled. - :paramtype is_local_data_guard_enabled: bool - :keyword is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS - connections. - :paramtype is_mtls_connection_required: bool - :keyword is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database - preview version is being provisioned. - :paramtype is_preview_version_with_service_terms_accepted: bool - :keyword license_model: The Oracle license model that applies to the Oracle Autonomous - Database. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and - "BringYourOwnLicense". - :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :keyword ncharacter_set: The character set for the Autonomous Database. - :paramtype ncharacter_set: str - :keyword scheduled_operations: The list of scheduled operations. - :paramtype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType - :keyword private_endpoint_ip: The private endpoint Ip address for the resource. - :paramtype private_endpoint_ip: str - :keyword private_endpoint_label: The resource's private endpoint label. - :paramtype private_endpoint_label: str - :keyword subnet_id: Client subnet. - :paramtype subnet_id: str - :keyword vnet_id: VNET for network connectivity. - :paramtype vnet_id: str - :keyword database_edition: The Oracle Database Edition that applies to the Autonomous - databases. Known values are: "StandardEdition" and "EnterpriseEdition". - :paramtype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType - :keyword autonomous_database_id: Autonomous Database ID. - :paramtype autonomous_database_id: str - :keyword long_term_backup_schedule: Details for the long-term backup schedule. - :paramtype long_term_backup_schedule: - ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails - :keyword local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an - acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered - when necessary for a Local Autonomous Data Guard. - :paramtype local_adg_auto_failover_max_data_loss_limit: int - :keyword open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and - "ReadWrite". - :paramtype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType - :keyword permission_level: The Autonomous Database permission level. Known values are: - "Restricted" and "Unrestricted". - :paramtype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType - :keyword role: The Data Guard role of the Autonomous Container Database or Autonomous Database, - if Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", - "BackupCopy", and "SnapshotStandby". - :paramtype role: str or ~azure.mgmt.oracledatabase.models.RoleType - :keyword backup_retention_period_in_days: Retention period, in days, for long-term backups. - :paramtype backup_retention_period_in_days: int - :keyword whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR - notations and/or IP addresses. Values should be separate strings, separated by commas. Example: - ['1.1.1.1','1.1.1.0/24','1.1.2.25']. - :paramtype whitelisted_ips: list[str] - :keyword source: The source of the database. Known values are: "None", "Database", - "BackupFromId", "BackupFromTimestamp", "CloneToRefreshable", "CrossRegionDataguard", and - "CrossRegionDisasterRecovery". - :paramtype source: str or ~azure.mgmt.oracledatabase.models.SourceType - :keyword source_id: The Azure ID of the Autonomous Database that was cloned to create the - current Autonomous Database. Required. - :paramtype source_id: str - :keyword clone_type: The Autonomous Database clone type. Required. Known values are: "Full" and - "Metadata". - :paramtype clone_type: str or ~azure.mgmt.oracledatabase.models.CloneType - :keyword refreshable_model: The refresh mode of the clone. Known values are: "Automatic" and - "Manual". - :paramtype refreshable_model: str or ~azure.mgmt.oracledatabase.models.RefreshableModelType - :keyword time_until_reconnect_clone_enabled: The time and date as an RFC3339 formatted string, - e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to - its source database. - :paramtype time_until_reconnect_clone_enabled: str - """ - super().__init__( - admin_password=admin_password, - autonomous_maintenance_schedule_type=autonomous_maintenance_schedule_type, - character_set=character_set, - compute_count=compute_count, - compute_model=compute_model, - cpu_core_count=cpu_core_count, - customer_contacts=customer_contacts, - data_storage_size_in_tbs=data_storage_size_in_tbs, - data_storage_size_in_gbs=data_storage_size_in_gbs, - db_version=db_version, - db_workload=db_workload, - display_name=display_name, - is_auto_scaling_enabled=is_auto_scaling_enabled, - is_auto_scaling_for_storage_enabled=is_auto_scaling_for_storage_enabled, - peer_db_id=peer_db_id, - is_local_data_guard_enabled=is_local_data_guard_enabled, - is_mtls_connection_required=is_mtls_connection_required, - is_preview_version_with_service_terms_accepted=is_preview_version_with_service_terms_accepted, - license_model=license_model, - ncharacter_set=ncharacter_set, - scheduled_operations=scheduled_operations, - private_endpoint_ip=private_endpoint_ip, - private_endpoint_label=private_endpoint_label, - subnet_id=subnet_id, - vnet_id=vnet_id, - database_edition=database_edition, - autonomous_database_id=autonomous_database_id, - long_term_backup_schedule=long_term_backup_schedule, - local_adg_auto_failover_max_data_loss_limit=local_adg_auto_failover_max_data_loss_limit, - open_mode=open_mode, - permission_level=permission_level, - role=role, - backup_retention_period_in_days=backup_retention_period_in_days, - whitelisted_ips=whitelisted_ips, - **kwargs - ) - self.data_base_type: str = "Clone" - self.source = source - self.source_id = source_id - self.clone_type = clone_type - self.is_reconnect_clone_enabled = None - self.is_refreshable_clone = None - self.refreshable_model = refreshable_model - self.refreshable_status = None - self.time_until_reconnect_clone_enabled = time_until_reconnect_clone_enabled - - -class AutonomousDatabaseListResult(_serialization.Model): - """The response of a AutonomousDatabase list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The AutonomousDatabase items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AutonomousDatabase]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.AutonomousDatabase"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The AutonomousDatabase items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class AutonomousDatabaseNationalCharacterSet(ProxyResource): - """AutonomousDatabaseNationalCharacterSets resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSetProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "AutonomousDatabaseNationalCharacterSetProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.AutonomousDatabaseNationalCharacterSetProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSetProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class AutonomousDatabaseNationalCharacterSetListResult(_serialization.Model): # pylint: disable=name-too-long - """The response of a AutonomousDatabaseNationalCharacterSet list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The AutonomousDatabaseNationalCharacterSet items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AutonomousDatabaseNationalCharacterSet]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: List["_models.AutonomousDatabaseNationalCharacterSet"], - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: The AutonomousDatabaseNationalCharacterSet items on this page. Required. - :paramtype value: - list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class AutonomousDatabaseNationalCharacterSetProperties(_serialization.Model): # pylint: disable=name-too-long - """AutonomousDatabaseNationalCharacterSet resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar character_set: The Oracle Autonomous Database supported national character sets. - Required. - :vartype character_set: str - """ - - _validation = { - "character_set": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "character_set": {"key": "characterSet", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.character_set = None - - -class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: disable=too-many-instance-attributes - """Autonomous Database resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar admin_password: Admin password. - :vartype admin_password: str - :ivar data_base_type: Database type to be created. Required. Known values are: "Regular" and - "Clone". - :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.DataBaseType - :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous - Database Serverless. Known values are: "Early" and "Regular". - :vartype autonomous_maintenance_schedule_type: str or - ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType - :ivar character_set: The character set for the autonomous database. - :vartype character_set: str - :ivar compute_count: The compute amount (CPUs) available to the database. - :vartype compute_count: float - :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and - "OCPU". - :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel - :ivar cpu_core_count: The number of CPU cores to be made available to the database. - :vartype cpu_core_count: int - :ivar customer_contacts: Customer Contacts. - :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :vartype data_storage_size_in_tbs: int - :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created - and attached to the database. - :vartype data_storage_size_in_gbs: int - :ivar db_version: A valid Oracle Database version for Autonomous Database. - :vartype db_version: str - :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", - "AJD", and "APEX". - :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType - :ivar display_name: The user-friendly name for the Autonomous Database. - :vartype display_name: str - :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database - CPU core count. - :vartype is_auto_scaling_enabled: bool - :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the - Autonomous Database storage. - :vartype is_auto_scaling_for_storage_enabled: bool - :ivar peer_db_ids: The list of `OCIDs - `_ of standby databases - located in Autonomous Data Guard remote regions that are associated with the source database. - Note that for Autonomous Database Serverless instances, standby databases located in the same - region as the source primary database do not have OCIDs. - :vartype peer_db_ids: list[str] - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. - :vartype peer_db_id: str - :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or - called in-region Data Guard enabled. - :vartype is_local_data_guard_enabled: bool - :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region - Data Guard enabled. - :vartype is_remote_data_guard_enabled: bool - :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the - Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business - critical DR with a faster recovery time objective (RTO) during failover or - switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or - switchover. Known values are: "Adg" and "BackupBased". - :vartype local_disaster_recovery_type: str or - ~azure.mgmt.oracledatabase.models.DisasterRecoveryType - :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. - :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary - :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data - Guard failover. - :vartype failed_data_recovery_in_seconds: int - :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS - connections. - :vartype is_mtls_connection_required: bool - :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database - preview version is being provisioned. - :vartype is_preview_version_with_service_terms_accepted: bool - :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. - The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :ivar ncharacter_set: The character set for the Autonomous Database. - :vartype ncharacter_set: str - :ivar lifecycle_details: Additional information about the current lifecycle state. - :vartype lifecycle_details: str - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", "Canceled", and "Provisioning". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState - :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", - "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", - "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", - "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", - "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState - :ivar scheduled_operations: The list of scheduled operations. - :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType - :ivar private_endpoint_ip: The private endpoint Ip address for the resource. - :vartype private_endpoint_ip: str - :ivar private_endpoint_label: The resource's private endpoint label. - :vartype private_endpoint_label: str - :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. - :vartype oci_url: str - :ivar subnet_id: Client subnet. - :vartype subnet_id: str - :ivar vnet_id: VNET for network connectivity. - :vartype vnet_id: str - :ivar time_created: The date and time that the database was created. - :vartype time_created: ~datetime.datetime - :ivar time_maintenance_begin: The date and time when maintenance will begin. - :vartype time_maintenance_begin: ~datetime.datetime - :ivar time_maintenance_end: The date and time when maintenance will end. - :vartype time_maintenance_end: ~datetime.datetime - :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and - system data, in terabytes (TB). - :vartype actual_used_data_storage_size_in_tbs: float - :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database - tables and billed for, rounded up. - :vartype allocated_storage_size_in_tbs: float - :ivar apex_details: Information about Oracle APEX Application Development. - :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType - :ivar available_upgrade_versions: List of Oracle Database versions available for a database - upgrade. If there are no version upgrades available, this list is empty. - :vartype available_upgrade_versions: list[str] - :ivar connection_strings: The connection string used to connect to the Autonomous Database. - :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType - :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL - Developer Web with a browser from a Compute instance within your VCN or that has a direct - connection to your VCN. - :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType - :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. - Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". - :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType - :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. - Known values are: "StandardEdition" and "EnterpriseEdition". - :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType - :ivar autonomous_database_id: Autonomous Database ID. - :vartype autonomous_database_id: str - :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. - :vartype in_memory_area_in_gbs: int - :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would - be created. - :vartype next_long_term_backup_time_stamp: ~datetime.datetime - :ivar long_term_backup_schedule: Details for the long-term backup schedule. - :vartype long_term_backup_schedule: - ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails - :ivar is_preview: Indicates if the Autonomous Database version is a preview version. - :vartype is_preview: bool - :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an - acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered - when necessary for a Local Autonomous Data Guard. - :vartype local_adg_auto_failover_max_data_loss_limit: int - :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or - OCPU. - :vartype memory_per_oracle_compute_unit_in_gbs: int - :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and - "ReadWrite". - :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType - :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. - Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and - "FailedDisabling". - :vartype operations_insights_status: str or - ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType - :ivar permission_level: The Autonomous Database permission level. Known values are: - "Restricted" and "Unrestricted". - :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType - :ivar private_endpoint: The private endpoint for the resource. - :vartype private_endpoint: str - :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. - :vartype provisionable_cpus: list[int] - :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if - Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", - "BackupCopy", and "SnapshotStandby". - :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType - :ivar service_console_url: The URL of the Service Console for the Autonomous Database. - :vartype service_console_url: str - :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. - :vartype sql_web_developer_url: str - :ivar supported_regions_to_clone_to: The list of regions that support the creation of an - Autonomous Database clone or an Autonomous Data Guard standby database. - :vartype supported_regions_to_clone_to: list[str] - :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was - switched for the Autonomous Database. - :vartype time_data_guard_role_changed: str - :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database - will be automatically deleted because of inactivity. - :vartype time_deletion_of_free_autonomous_database: str - :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled - for an Autonomous Database where the standby was provisioned in the same region as the primary - database. - :vartype time_local_data_guard_enabled: str - :ivar time_of_last_failover: The timestamp of the last failover operation. - :vartype time_of_last_failover: str - :ivar time_of_last_refresh: The date and time when last refresh happened. - :vartype time_of_last_refresh: str - :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). - :vartype time_of_last_refresh_point: str - :ivar time_of_last_switchover: The timestamp of the last switchover operation for the - Autonomous Database. - :vartype time_of_last_switchover: str - :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database - will be stopped because of inactivity. - :vartype time_reclamation_of_free_autonomous_database: str - :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. - :vartype used_data_storage_size_in_gbs: int - :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. - :vartype used_data_storage_size_in_tbs: int - :ivar ocid: Database ocid. - :vartype ocid: str - :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. - :vartype backup_retention_period_in_days: int - :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR - notations and/or IP addresses. Values should be separate strings, separated by commas. Example: - ['1.1.1.1','1.1.1.0/24','1.1.2.25']. - :vartype whitelisted_ips: list[str] - """ - - _validation = { - "data_base_type": {"required": True}, - "character_set": {"max_length": 255, "min_length": 1}, - "compute_count": {"maximum": 512, "minimum": 0.1}, - "cpu_core_count": {"maximum": 128, "minimum": 1}, - "data_storage_size_in_tbs": {"maximum": 384, "minimum": 1}, - "data_storage_size_in_gbs": {"maximum": 393216, "minimum": 20}, - "db_version": {"max_length": 255, "min_length": 1}, - "display_name": {"max_length": 255, "min_length": 1}, - "peer_db_ids": {"readonly": True}, - "peer_db_id": {"max_length": 255, "min_length": 1}, - "is_remote_data_guard_enabled": {"readonly": True}, - "local_disaster_recovery_type": {"readonly": True}, - "local_standby_db": {"readonly": True}, - "failed_data_recovery_in_seconds": {"readonly": True}, - "ncharacter_set": {"max_length": 255, "min_length": 1}, - "lifecycle_details": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "oci_url": {"readonly": True}, - "time_created": {"readonly": True}, - "time_maintenance_begin": {"readonly": True}, - "time_maintenance_end": {"readonly": True}, - "actual_used_data_storage_size_in_tbs": {"readonly": True}, - "allocated_storage_size_in_tbs": {"readonly": True}, - "apex_details": {"readonly": True}, - "available_upgrade_versions": {"readonly": True}, - "connection_strings": {"readonly": True}, - "connection_urls": {"readonly": True}, - "data_safe_status": {"readonly": True}, - "in_memory_area_in_gbs": {"readonly": True}, - "next_long_term_backup_time_stamp": {"readonly": True}, - "is_preview": {"readonly": True}, - "local_adg_auto_failover_max_data_loss_limit": {"maximum": 3600, "minimum": 0}, - "memory_per_oracle_compute_unit_in_gbs": {"readonly": True}, - "operations_insights_status": {"readonly": True}, - "private_endpoint": {"readonly": True}, - "provisionable_cpus": {"readonly": True}, - "service_console_url": {"readonly": True, "max_length": 255, "min_length": 10}, - "sql_web_developer_url": {"readonly": True, "max_length": 2048, "min_length": 10}, - "supported_regions_to_clone_to": {"readonly": True, "max_items": 50, "min_items": 0}, - "time_data_guard_role_changed": {"readonly": True}, - "time_deletion_of_free_autonomous_database": {"readonly": True}, - "time_local_data_guard_enabled": {"readonly": True}, - "time_of_last_failover": {"readonly": True}, - "time_of_last_refresh": {"readonly": True}, - "time_of_last_refresh_point": {"readonly": True}, - "time_of_last_switchover": {"readonly": True}, - "time_reclamation_of_free_autonomous_database": {"readonly": True}, - "used_data_storage_size_in_gbs": {"readonly": True}, - "used_data_storage_size_in_tbs": {"readonly": True}, - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "admin_password": {"key": "adminPassword", "type": "str"}, - "data_base_type": {"key": "dataBaseType", "type": "str"}, - "autonomous_maintenance_schedule_type": {"key": "autonomousMaintenanceScheduleType", "type": "str"}, - "character_set": {"key": "characterSet", "type": "str"}, - "compute_count": {"key": "computeCount", "type": "float"}, - "compute_model": {"key": "computeModel", "type": "str"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "int"}, - "data_storage_size_in_gbs": {"key": "dataStorageSizeInGbs", "type": "int"}, - "db_version": {"key": "dbVersion", "type": "str"}, - "db_workload": {"key": "dbWorkload", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "is_auto_scaling_enabled": {"key": "isAutoScalingEnabled", "type": "bool"}, - "is_auto_scaling_for_storage_enabled": {"key": "isAutoScalingForStorageEnabled", "type": "bool"}, - "peer_db_ids": {"key": "peerDbIds", "type": "[str]"}, - "peer_db_id": {"key": "peerDbId", "type": "str"}, - "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, - "is_remote_data_guard_enabled": {"key": "isRemoteDataGuardEnabled", "type": "bool"}, - "local_disaster_recovery_type": {"key": "localDisasterRecoveryType", "type": "str"}, - "local_standby_db": {"key": "localStandbyDb", "type": "AutonomousDatabaseStandbySummary"}, - "failed_data_recovery_in_seconds": {"key": "failedDataRecoveryInSeconds", "type": "int"}, - "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, - "is_preview_version_with_service_terms_accepted": { - "key": "isPreviewVersionWithServiceTermsAccepted", - "type": "bool", - }, - "license_model": {"key": "licenseModel", "type": "str"}, - "ncharacter_set": {"key": "ncharacterSet", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "scheduled_operations": {"key": "scheduledOperations", "type": "ScheduledOperationsType"}, - "private_endpoint_ip": {"key": "privateEndpointIp", "type": "str"}, - "private_endpoint_label": {"key": "privateEndpointLabel", "type": "str"}, - "oci_url": {"key": "ociUrl", "type": "str"}, - "subnet_id": {"key": "subnetId", "type": "str"}, - "vnet_id": {"key": "vnetId", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "time_maintenance_begin": {"key": "timeMaintenanceBegin", "type": "iso-8601"}, - "time_maintenance_end": {"key": "timeMaintenanceEnd", "type": "iso-8601"}, - "actual_used_data_storage_size_in_tbs": {"key": "actualUsedDataStorageSizeInTbs", "type": "float"}, - "allocated_storage_size_in_tbs": {"key": "allocatedStorageSizeInTbs", "type": "float"}, - "apex_details": {"key": "apexDetails", "type": "ApexDetailsType"}, - "available_upgrade_versions": {"key": "availableUpgradeVersions", "type": "[str]"}, - "connection_strings": {"key": "connectionStrings", "type": "ConnectionStringType"}, - "connection_urls": {"key": "connectionUrls", "type": "ConnectionUrlType"}, - "data_safe_status": {"key": "dataSafeStatus", "type": "str"}, - "database_edition": {"key": "databaseEdition", "type": "str"}, - "autonomous_database_id": {"key": "autonomousDatabaseId", "type": "str"}, - "in_memory_area_in_gbs": {"key": "inMemoryAreaInGbs", "type": "int"}, - "next_long_term_backup_time_stamp": {"key": "nextLongTermBackupTimeStamp", "type": "iso-8601"}, - "long_term_backup_schedule": {"key": "longTermBackupSchedule", "type": "LongTermBackUpScheduleDetails"}, - "is_preview": {"key": "isPreview", "type": "bool"}, - "local_adg_auto_failover_max_data_loss_limit": {"key": "localAdgAutoFailoverMaxDataLossLimit", "type": "int"}, - "memory_per_oracle_compute_unit_in_gbs": {"key": "memoryPerOracleComputeUnitInGbs", "type": "int"}, - "open_mode": {"key": "openMode", "type": "str"}, - "operations_insights_status": {"key": "operationsInsightsStatus", "type": "str"}, - "permission_level": {"key": "permissionLevel", "type": "str"}, - "private_endpoint": {"key": "privateEndpoint", "type": "str"}, - "provisionable_cpus": {"key": "provisionableCpus", "type": "[int]"}, - "role": {"key": "role", "type": "str"}, - "service_console_url": {"key": "serviceConsoleUrl", "type": "str"}, - "sql_web_developer_url": {"key": "sqlWebDeveloperUrl", "type": "str"}, - "supported_regions_to_clone_to": {"key": "supportedRegionsToCloneTo", "type": "[str]"}, - "time_data_guard_role_changed": {"key": "timeDataGuardRoleChanged", "type": "str"}, - "time_deletion_of_free_autonomous_database": {"key": "timeDeletionOfFreeAutonomousDatabase", "type": "str"}, - "time_local_data_guard_enabled": {"key": "timeLocalDataGuardEnabled", "type": "str"}, - "time_of_last_failover": {"key": "timeOfLastFailover", "type": "str"}, - "time_of_last_refresh": {"key": "timeOfLastRefresh", "type": "str"}, - "time_of_last_refresh_point": {"key": "timeOfLastRefreshPoint", "type": "str"}, - "time_of_last_switchover": {"key": "timeOfLastSwitchover", "type": "str"}, - "time_reclamation_of_free_autonomous_database": { - "key": "timeReclamationOfFreeAutonomousDatabase", - "type": "str", - }, - "used_data_storage_size_in_gbs": {"key": "usedDataStorageSizeInGbs", "type": "int"}, - "used_data_storage_size_in_tbs": {"key": "usedDataStorageSizeInTbs", "type": "int"}, - "ocid": {"key": "ocid", "type": "str"}, - "backup_retention_period_in_days": {"key": "backupRetentionPeriodInDays", "type": "int"}, - "whitelisted_ips": {"key": "whitelistedIps", "type": "[str]"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - admin_password: Optional[str] = None, - autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, - character_set: Optional[str] = None, - compute_count: Optional[float] = None, - compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, - cpu_core_count: Optional[int] = None, - customer_contacts: Optional[List["_models.CustomerContact"]] = None, - data_storage_size_in_tbs: Optional[int] = None, - data_storage_size_in_gbs: Optional[int] = None, - db_version: Optional[str] = None, - db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, - display_name: Optional[str] = None, - is_auto_scaling_enabled: Optional[bool] = None, - is_auto_scaling_for_storage_enabled: Optional[bool] = None, - peer_db_id: Optional[str] = None, - is_local_data_guard_enabled: Optional[bool] = None, - is_mtls_connection_required: Optional[bool] = None, - is_preview_version_with_service_terms_accepted: Optional[bool] = None, - license_model: Optional[Union[str, "_models.LicenseModel"]] = None, - ncharacter_set: Optional[str] = None, - scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, - private_endpoint_ip: Optional[str] = None, - private_endpoint_label: Optional[str] = None, - subnet_id: Optional[str] = None, - vnet_id: Optional[str] = None, - database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, - autonomous_database_id: Optional[str] = None, - long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, - local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, - open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, - permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, - role: Optional[Union[str, "_models.RoleType"]] = None, - backup_retention_period_in_days: Optional[int] = None, - whitelisted_ips: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword admin_password: Admin password. - :paramtype admin_password: str - :keyword autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous - Database Serverless. Known values are: "Early" and "Regular". - :paramtype autonomous_maintenance_schedule_type: str or - ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType - :keyword character_set: The character set for the autonomous database. - :paramtype character_set: str - :keyword compute_count: The compute amount (CPUs) available to the database. - :paramtype compute_count: float - :keyword compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" - and "OCPU". - :paramtype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel - :keyword cpu_core_count: The number of CPU cores to be made available to the database. - :paramtype cpu_core_count: int - :keyword customer_contacts: Customer Contacts. - :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :keyword data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :paramtype data_storage_size_in_tbs: int - :keyword data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be - created and attached to the database. - :paramtype data_storage_size_in_gbs: int - :keyword db_version: A valid Oracle Database version for Autonomous Database. - :paramtype db_version: str - :keyword db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", - "AJD", and "APEX". - :paramtype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType - :keyword display_name: The user-friendly name for the Autonomous Database. - :paramtype display_name: str - :keyword is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous - Database CPU core count. - :paramtype is_auto_scaling_enabled: bool - :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the - Autonomous Database storage. - :paramtype is_auto_scaling_for_storage_enabled: bool - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. - :paramtype peer_db_id: str - :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or - called in-region Data Guard enabled. - :paramtype is_local_data_guard_enabled: bool - :keyword is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS - connections. - :paramtype is_mtls_connection_required: bool - :keyword is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database - preview version is being provisioned. - :paramtype is_preview_version_with_service_terms_accepted: bool - :keyword license_model: The Oracle license model that applies to the Oracle Autonomous - Database. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and - "BringYourOwnLicense". - :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :keyword ncharacter_set: The character set for the Autonomous Database. - :paramtype ncharacter_set: str - :keyword scheduled_operations: The list of scheduled operations. - :paramtype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType - :keyword private_endpoint_ip: The private endpoint Ip address for the resource. - :paramtype private_endpoint_ip: str - :keyword private_endpoint_label: The resource's private endpoint label. - :paramtype private_endpoint_label: str - :keyword subnet_id: Client subnet. - :paramtype subnet_id: str - :keyword vnet_id: VNET for network connectivity. - :paramtype vnet_id: str - :keyword database_edition: The Oracle Database Edition that applies to the Autonomous - databases. Known values are: "StandardEdition" and "EnterpriseEdition". - :paramtype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType - :keyword autonomous_database_id: Autonomous Database ID. - :paramtype autonomous_database_id: str - :keyword long_term_backup_schedule: Details for the long-term backup schedule. - :paramtype long_term_backup_schedule: - ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails - :keyword local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an - acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered - when necessary for a Local Autonomous Data Guard. - :paramtype local_adg_auto_failover_max_data_loss_limit: int - :keyword open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and - "ReadWrite". - :paramtype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType - :keyword permission_level: The Autonomous Database permission level. Known values are: - "Restricted" and "Unrestricted". - :paramtype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType - :keyword role: The Data Guard role of the Autonomous Container Database or Autonomous Database, - if Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", - "BackupCopy", and "SnapshotStandby". - :paramtype role: str or ~azure.mgmt.oracledatabase.models.RoleType - :keyword backup_retention_period_in_days: Retention period, in days, for long-term backups. - :paramtype backup_retention_period_in_days: int - :keyword whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR - notations and/or IP addresses. Values should be separate strings, separated by commas. Example: - ['1.1.1.1','1.1.1.0/24','1.1.2.25']. - :paramtype whitelisted_ips: list[str] - """ - super().__init__( - admin_password=admin_password, - autonomous_maintenance_schedule_type=autonomous_maintenance_schedule_type, - character_set=character_set, - compute_count=compute_count, - compute_model=compute_model, - cpu_core_count=cpu_core_count, - customer_contacts=customer_contacts, - data_storage_size_in_tbs=data_storage_size_in_tbs, - data_storage_size_in_gbs=data_storage_size_in_gbs, - db_version=db_version, - db_workload=db_workload, - display_name=display_name, - is_auto_scaling_enabled=is_auto_scaling_enabled, - is_auto_scaling_for_storage_enabled=is_auto_scaling_for_storage_enabled, - peer_db_id=peer_db_id, - is_local_data_guard_enabled=is_local_data_guard_enabled, - is_mtls_connection_required=is_mtls_connection_required, - is_preview_version_with_service_terms_accepted=is_preview_version_with_service_terms_accepted, - license_model=license_model, - ncharacter_set=ncharacter_set, - scheduled_operations=scheduled_operations, - private_endpoint_ip=private_endpoint_ip, - private_endpoint_label=private_endpoint_label, - subnet_id=subnet_id, - vnet_id=vnet_id, - database_edition=database_edition, - autonomous_database_id=autonomous_database_id, - long_term_backup_schedule=long_term_backup_schedule, - local_adg_auto_failover_max_data_loss_limit=local_adg_auto_failover_max_data_loss_limit, - open_mode=open_mode, - permission_level=permission_level, - role=role, - backup_retention_period_in_days=backup_retention_period_in_days, - whitelisted_ips=whitelisted_ips, - **kwargs - ) - self.data_base_type: str = "Regular" - - -class AutonomousDatabaseStandbySummary(_serialization.Model): - """Autonomous Disaster Recovery standby database details. - - :ivar lag_time_in_seconds: The amount of time, in seconds, that the data of the standby - database lags the data of the primary database. Can be used to determine the potential data - loss in the event of a failover. - :vartype lag_time_in_seconds: int - :ivar lifecycle_state: The current state of the Autonomous Database. Known values are: - "Provisioning", "Available", "Stopping", "Stopped", "Starting", "Terminating", "Terminated", - "Unavailable", "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", - "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", - "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState - :ivar lifecycle_details: Additional information about the current lifecycle state. - :vartype lifecycle_details: str - :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was - switched for the standby Autonomous Database. - :vartype time_data_guard_role_changed: str - :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was - switched for the standby Autonomous Database. - :vartype time_disaster_recovery_role_changed: str - """ - - _attribute_map = { - "lag_time_in_seconds": {"key": "lagTimeInSeconds", "type": "int"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "time_data_guard_role_changed": {"key": "timeDataGuardRoleChanged", "type": "str"}, - "time_disaster_recovery_role_changed": {"key": "timeDisasterRecoveryRoleChanged", "type": "str"}, - } - - def __init__( - self, - *, - lag_time_in_seconds: Optional[int] = None, - lifecycle_state: Optional[Union[str, "_models.AutonomousDatabaseLifecycleState"]] = None, - lifecycle_details: Optional[str] = None, - time_data_guard_role_changed: Optional[str] = None, - time_disaster_recovery_role_changed: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword lag_time_in_seconds: The amount of time, in seconds, that the data of the standby - database lags the data of the primary database. Can be used to determine the potential data - loss in the event of a failover. - :paramtype lag_time_in_seconds: int - :keyword lifecycle_state: The current state of the Autonomous Database. Known values are: - "Provisioning", "Available", "Stopping", "Stopped", "Starting", "Terminating", "Terminated", - "Unavailable", "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", - "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", - "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". - :paramtype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState - :keyword lifecycle_details: Additional information about the current lifecycle state. - :paramtype lifecycle_details: str - :keyword time_data_guard_role_changed: The date and time the Autonomous Data Guard role was - switched for the standby Autonomous Database. - :paramtype time_data_guard_role_changed: str - :keyword time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was - switched for the standby Autonomous Database. - :paramtype time_disaster_recovery_role_changed: str - """ - super().__init__(**kwargs) - self.lag_time_in_seconds = lag_time_in_seconds - self.lifecycle_state = lifecycle_state - self.lifecycle_details = lifecycle_details - self.time_data_guard_role_changed = time_data_guard_role_changed - self.time_disaster_recovery_role_changed = time_disaster_recovery_role_changed - - -class AutonomousDatabaseUpdate(_serialization.Model): - """The type used for update operations of the AutonomousDatabase. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The updatable properties of the AutonomousDatabase. - :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdateProperties - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "AutonomousDatabaseUpdateProperties"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.AutonomousDatabaseUpdateProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: The updatable properties of the AutonomousDatabase. - :paramtype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdateProperties - """ - super().__init__(**kwargs) - self.tags = tags - self.properties = properties - - -class AutonomousDatabaseUpdateProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The updatable properties of the AutonomousDatabase. - - :ivar admin_password: Admin password. - :vartype admin_password: str - :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous - Database Serverless. Known values are: "Early" and "Regular". - :vartype autonomous_maintenance_schedule_type: str or - ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType - :ivar compute_count: The compute amount (CPUs) available to the database. - :vartype compute_count: float - :ivar cpu_core_count: The number of CPU cores to be made available to the database. - :vartype cpu_core_count: int - :ivar customer_contacts: Customer Contacts. - :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :vartype data_storage_size_in_tbs: int - :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created - and attached to the database. - :vartype data_storage_size_in_gbs: int - :ivar display_name: The user-friendly name for the Autonomous Database. - :vartype display_name: str - :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database - CPU core count. - :vartype is_auto_scaling_enabled: bool - :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the - Autonomous Database storage. - :vartype is_auto_scaling_for_storage_enabled: bool - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. - :vartype peer_db_id: str - :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or - called in-region Data Guard enabled. - :vartype is_local_data_guard_enabled: bool - :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS - connections. - :vartype is_mtls_connection_required: bool - :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. - The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :ivar scheduled_operations: The list of scheduled operations. - :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsTypeUpdate - :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. - Known values are: "StandardEdition" and "EnterpriseEdition". - :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType - :ivar long_term_backup_schedule: Details for the long-term backup schedule. - :vartype long_term_backup_schedule: - ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails - :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an - acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered - when necessary for a Local Autonomous Data Guard. - :vartype local_adg_auto_failover_max_data_loss_limit: int - :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and - "ReadWrite". - :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType - :ivar permission_level: The Autonomous Database permission level. Known values are: - "Restricted" and "Unrestricted". - :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType - :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if - Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", - "BackupCopy", and "SnapshotStandby". - :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType - :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. - :vartype backup_retention_period_in_days: int - :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR - notations and/or IP addresses. Values should be separate strings, separated by commas. Example: - ['1.1.1.1','1.1.1.0/24','1.1.2.25']. - :vartype whitelisted_ips: list[str] - """ - - _validation = { - "compute_count": {"maximum": 512, "minimum": 0.1}, - "cpu_core_count": {"maximum": 128, "minimum": 1}, - "data_storage_size_in_tbs": {"maximum": 384, "minimum": 1}, - "data_storage_size_in_gbs": {"maximum": 393216, "minimum": 20}, - "display_name": {"max_length": 255, "min_length": 1}, - "peer_db_id": {"max_length": 255, "min_length": 1}, - "local_adg_auto_failover_max_data_loss_limit": {"maximum": 3600, "minimum": 0}, - } - - _attribute_map = { - "admin_password": {"key": "adminPassword", "type": "str"}, - "autonomous_maintenance_schedule_type": {"key": "autonomousMaintenanceScheduleType", "type": "str"}, - "compute_count": {"key": "computeCount", "type": "float"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "int"}, - "data_storage_size_in_gbs": {"key": "dataStorageSizeInGbs", "type": "int"}, - "display_name": {"key": "displayName", "type": "str"}, - "is_auto_scaling_enabled": {"key": "isAutoScalingEnabled", "type": "bool"}, - "is_auto_scaling_for_storage_enabled": {"key": "isAutoScalingForStorageEnabled", "type": "bool"}, - "peer_db_id": {"key": "peerDbId", "type": "str"}, - "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, - "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, - "license_model": {"key": "licenseModel", "type": "str"}, - "scheduled_operations": {"key": "scheduledOperations", "type": "ScheduledOperationsTypeUpdate"}, - "database_edition": {"key": "databaseEdition", "type": "str"}, - "long_term_backup_schedule": {"key": "longTermBackupSchedule", "type": "LongTermBackUpScheduleDetails"}, - "local_adg_auto_failover_max_data_loss_limit": {"key": "localAdgAutoFailoverMaxDataLossLimit", "type": "int"}, - "open_mode": {"key": "openMode", "type": "str"}, - "permission_level": {"key": "permissionLevel", "type": "str"}, - "role": {"key": "role", "type": "str"}, - "backup_retention_period_in_days": {"key": "backupRetentionPeriodInDays", "type": "int"}, - "whitelisted_ips": {"key": "whitelistedIps", "type": "[str]"}, - } - - def __init__( - self, - *, - admin_password: Optional[str] = None, - autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, - compute_count: Optional[float] = None, - cpu_core_count: Optional[int] = None, - customer_contacts: Optional[List["_models.CustomerContact"]] = None, - data_storage_size_in_tbs: Optional[int] = None, - data_storage_size_in_gbs: Optional[int] = None, - display_name: Optional[str] = None, - is_auto_scaling_enabled: Optional[bool] = None, - is_auto_scaling_for_storage_enabled: Optional[bool] = None, - peer_db_id: Optional[str] = None, - is_local_data_guard_enabled: Optional[bool] = None, - is_mtls_connection_required: Optional[bool] = None, - license_model: Optional[Union[str, "_models.LicenseModel"]] = None, - scheduled_operations: Optional["_models.ScheduledOperationsTypeUpdate"] = None, - database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, - long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, - local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, - open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, - permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, - role: Optional[Union[str, "_models.RoleType"]] = None, - backup_retention_period_in_days: Optional[int] = None, - whitelisted_ips: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword admin_password: Admin password. - :paramtype admin_password: str - :keyword autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous - Database Serverless. Known values are: "Early" and "Regular". - :paramtype autonomous_maintenance_schedule_type: str or - ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType - :keyword compute_count: The compute amount (CPUs) available to the database. - :paramtype compute_count: float - :keyword cpu_core_count: The number of CPU cores to be made available to the database. - :paramtype cpu_core_count: int - :keyword customer_contacts: Customer Contacts. - :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :keyword data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :paramtype data_storage_size_in_tbs: int - :keyword data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be - created and attached to the database. - :paramtype data_storage_size_in_gbs: int - :keyword display_name: The user-friendly name for the Autonomous Database. - :paramtype display_name: str - :keyword is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous - Database CPU core count. - :paramtype is_auto_scaling_enabled: bool - :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the - Autonomous Database storage. - :paramtype is_auto_scaling_for_storage_enabled: bool - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. - :paramtype peer_db_id: str - :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or - called in-region Data Guard enabled. - :paramtype is_local_data_guard_enabled: bool - :keyword is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS - connections. - :paramtype is_mtls_connection_required: bool - :keyword license_model: The Oracle license model that applies to the Oracle Autonomous - Database. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and - "BringYourOwnLicense". - :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :keyword scheduled_operations: The list of scheduled operations. - :paramtype scheduled_operations: - ~azure.mgmt.oracledatabase.models.ScheduledOperationsTypeUpdate - :keyword database_edition: The Oracle Database Edition that applies to the Autonomous - databases. Known values are: "StandardEdition" and "EnterpriseEdition". - :paramtype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType - :keyword long_term_backup_schedule: Details for the long-term backup schedule. - :paramtype long_term_backup_schedule: - ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails - :keyword local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an - acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered - when necessary for a Local Autonomous Data Guard. - :paramtype local_adg_auto_failover_max_data_loss_limit: int - :keyword open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and - "ReadWrite". - :paramtype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType - :keyword permission_level: The Autonomous Database permission level. Known values are: - "Restricted" and "Unrestricted". - :paramtype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType - :keyword role: The Data Guard role of the Autonomous Container Database or Autonomous Database, - if Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", - "BackupCopy", and "SnapshotStandby". - :paramtype role: str or ~azure.mgmt.oracledatabase.models.RoleType - :keyword backup_retention_period_in_days: Retention period, in days, for long-term backups. - :paramtype backup_retention_period_in_days: int - :keyword whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR - notations and/or IP addresses. Values should be separate strings, separated by commas. Example: - ['1.1.1.1','1.1.1.0/24','1.1.2.25']. - :paramtype whitelisted_ips: list[str] - """ - super().__init__(**kwargs) - self.admin_password = admin_password - self.autonomous_maintenance_schedule_type = autonomous_maintenance_schedule_type - self.compute_count = compute_count - self.cpu_core_count = cpu_core_count - self.customer_contacts = customer_contacts - self.data_storage_size_in_tbs = data_storage_size_in_tbs - self.data_storage_size_in_gbs = data_storage_size_in_gbs - self.display_name = display_name - self.is_auto_scaling_enabled = is_auto_scaling_enabled - self.is_auto_scaling_for_storage_enabled = is_auto_scaling_for_storage_enabled - self.peer_db_id = peer_db_id - self.is_local_data_guard_enabled = is_local_data_guard_enabled - self.is_mtls_connection_required = is_mtls_connection_required - self.license_model = license_model - self.scheduled_operations = scheduled_operations - self.database_edition = database_edition - self.long_term_backup_schedule = long_term_backup_schedule - self.local_adg_auto_failover_max_data_loss_limit = local_adg_auto_failover_max_data_loss_limit - self.open_mode = open_mode - self.permission_level = permission_level - self.role = role - self.backup_retention_period_in_days = backup_retention_period_in_days - self.whitelisted_ips = whitelisted_ips - - -class AutonomousDatabaseWalletFile(_serialization.Model): - """Autonomous Database Wallet File resource model. - - All required parameters must be populated in order to send to server. - - :ivar wallet_files: The base64 encoded wallet files. Required. - :vartype wallet_files: str - """ - - _validation = { - "wallet_files": {"required": True}, - } - - _attribute_map = { - "wallet_files": {"key": "walletFiles", "type": "str"}, - } - - def __init__(self, *, wallet_files: str, **kwargs: Any) -> None: - """ - :keyword wallet_files: The base64 encoded wallet files. Required. - :paramtype wallet_files: str - """ - super().__init__(**kwargs) - self.wallet_files = wallet_files - - -class AutonomousDbVersion(ProxyResource): - """AutonomousDbVersion resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDbVersionProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "AutonomousDbVersionProperties"}, - } - - def __init__(self, *, properties: Optional["_models.AutonomousDbVersionProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.AutonomousDbVersionProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class AutonomousDbVersionListResult(_serialization.Model): - """The response of a AutonomousDbVersion list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The AutonomousDbVersion items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AutonomousDbVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.AutonomousDbVersion"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The AutonomousDbVersion items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class AutonomousDbVersionProperties(_serialization.Model): - """AutonomousDbVersion resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar version: Supported Autonomous Db versions. Required. - :vartype version: str - :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", - "AJD", and "APEX". - :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType - :ivar is_default_for_free: True if this version of the Oracle Database software's default is - free. - :vartype is_default_for_free: bool - :ivar is_default_for_paid: True if this version of the Oracle Database software's default is - paid. - :vartype is_default_for_paid: bool - :ivar is_free_tier_enabled: True if this version of the Oracle Database software can be used - for Always-Free Autonomous Databases. - :vartype is_free_tier_enabled: bool - :ivar is_paid_enabled: True if this version of the Oracle Database software has payments - enabled. - :vartype is_paid_enabled: bool - """ - - _validation = { - "version": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "db_workload": {"readonly": True}, - "is_default_for_free": {"readonly": True}, - "is_default_for_paid": {"readonly": True}, - "is_free_tier_enabled": {"readonly": True}, - "is_paid_enabled": {"readonly": True}, - } - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - "db_workload": {"key": "dbWorkload", "type": "str"}, - "is_default_for_free": {"key": "isDefaultForFree", "type": "bool"}, - "is_default_for_paid": {"key": "isDefaultForPaid", "type": "bool"}, - "is_free_tier_enabled": {"key": "isFreeTierEnabled", "type": "bool"}, - "is_paid_enabled": {"key": "isPaidEnabled", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.version = None - self.db_workload = None - self.is_default_for_free = None - self.is_default_for_paid = None - self.is_free_tier_enabled = None - self.is_paid_enabled = None - - -class CloudAccountDetails(_serialization.Model): - """Cloud Account Details model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cloud_account_name: Cloud Account name. - :vartype cloud_account_name: str - :ivar cloud_account_home_region: Cloud Account Home region. - :vartype cloud_account_home_region: str - """ - - _validation = { - "cloud_account_name": {"readonly": True}, - "cloud_account_home_region": {"readonly": True}, - } - - _attribute_map = { - "cloud_account_name": {"key": "cloudAccountName", "type": "str"}, - "cloud_account_home_region": {"key": "cloudAccountHomeRegion", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.cloud_account_name = None - self.cloud_account_home_region = None - - -class CloudExadataInfrastructure(TrackedResource): - """CloudExadataInfrastructure 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: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureProperties - :ivar zones: CloudExadataInfrastructure zones. Required. - :vartype zones: list[str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "zones": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "CloudExadataInfrastructureProperties"}, - "zones": {"key": "zones", "type": "[str]"}, - } - - def __init__( - self, - *, - location: str, - zones: List[str], - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CloudExadataInfrastructureProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureProperties - :keyword zones: CloudExadataInfrastructure zones. Required. - :paramtype zones: list[str] - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - self.zones = zones - - -class CloudExadataInfrastructureListResult(_serialization.Model): - """The response of a CloudExadataInfrastructure list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The CloudExadataInfrastructure items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[CloudExadataInfrastructure]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.CloudExadataInfrastructure"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The CloudExadataInfrastructure items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class CloudExadataInfrastructureProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """CloudExadataInfrastructure resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar ocid: Exadata infra ocid. - :vartype ocid: str - :ivar compute_count: The number of compute servers for the cloud Exadata infrastructure. - :vartype compute_count: int - :ivar storage_count: The number of storage servers for the cloud Exadata infrastructure. - :vartype storage_count: int - :ivar total_storage_size_in_gbs: The total storage allocated to the cloud Exadata - infrastructure resource, in gigabytes (GB). - :vartype total_storage_size_in_gbs: int - :ivar available_storage_size_in_gbs: The available storage can be allocated to the cloud - Exadata infrastructure resource, in gigabytes (GB). - :vartype available_storage_size_in_gbs: int - :ivar time_created: The date and time the cloud Exadata infrastructure resource was created. - :vartype time_created: str - :ivar lifecycle_details: Additional information about the current lifecycle state. - :vartype lifecycle_details: str - :ivar maintenance_window: maintenanceWindow property. - :vartype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow - :ivar estimated_patching_time: The estimated total time required in minutes for all patching - operations (database server, storage server, and network switch patching). - :vartype estimated_patching_time: ~azure.mgmt.oracledatabase.models.EstimatedPatchingTime - :ivar customer_contacts: The list of customer email addresses that receive information from - Oracle about the specified OCI Database service resource. Oracle uses these email addresses to - send notifications about planned and unplanned software maintenance updates, information about - system hardware, and other information needed by administrators. Up to 10 email addresses can - be added to the customer contacts for a cloud Exadata infrastructure instance. - :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :ivar provisioning_state: CloudExadataInfrastructure provisioning state. Known values are: - "Succeeded", "Failed", "Canceled", and "Provisioning". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState - :ivar lifecycle_state: CloudExadataInfrastructure lifecycle state. Known values are: - "Provisioning", "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", - and "Failed". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureLifecycleState - :ivar shape: The model name of the cloud Exadata infrastructure resource. Required. - :vartype shape: str - :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. - :vartype oci_url: str - :ivar cpu_count: The total number of CPU cores allocated. - :vartype cpu_count: int - :ivar max_cpu_count: The total number of CPU cores available. - :vartype max_cpu_count: int - :ivar memory_size_in_gbs: The memory allocated in GBs. - :vartype memory_size_in_gbs: int - :ivar max_memory_in_gbs: The total memory available in GBs. - :vartype max_memory_in_gbs: int - :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. - :vartype db_node_storage_size_in_gbs: int - :ivar max_db_node_storage_size_in_gbs: The total local node storage available in GBs. - :vartype max_db_node_storage_size_in_gbs: int - :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :vartype data_storage_size_in_tbs: float - :ivar max_data_storage_in_tbs: The total available DATA disk group size. - :vartype max_data_storage_in_tbs: float - :ivar db_server_version: The software version of the database servers (dom0) in the Exadata - infrastructure. - :vartype db_server_version: str - :ivar storage_server_version: The software version of the storage servers (cells) in the - Exadata infrastructure. - :vartype storage_server_version: str - :ivar activated_storage_count: The requested number of additional storage servers activated for - the Exadata infrastructure. - :vartype activated_storage_count: int - :ivar additional_storage_count: The requested number of additional storage servers for the - Exadata infrastructure. - :vartype additional_storage_count: int - :ivar display_name: The name for the Exadata infrastructure. Required. - :vartype display_name: str - :ivar last_maintenance_run_id: The OCID of the last maintenance run. - :vartype last_maintenance_run_id: str - :ivar next_maintenance_run_id: The OCID of the next maintenance run. - :vartype next_maintenance_run_id: str - :ivar monthly_db_server_version: Monthly Db Server version. - :vartype monthly_db_server_version: str - :ivar monthly_storage_server_version: Monthly Storage Server version. - :vartype monthly_storage_server_version: str - """ - - _validation = { - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "total_storage_size_in_gbs": {"readonly": True}, - "available_storage_size_in_gbs": {"readonly": True}, - "time_created": {"readonly": True}, - "lifecycle_details": {"readonly": True}, - "estimated_patching_time": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "shape": {"required": True}, - "oci_url": {"readonly": True}, - "cpu_count": {"readonly": True}, - "max_cpu_count": {"readonly": True}, - "memory_size_in_gbs": {"readonly": True}, - "max_memory_in_gbs": {"readonly": True}, - "db_node_storage_size_in_gbs": {"readonly": True}, - "max_db_node_storage_size_in_gbs": {"readonly": True}, - "data_storage_size_in_tbs": {"readonly": True}, - "max_data_storage_in_tbs": {"readonly": True}, - "db_server_version": {"readonly": True}, - "storage_server_version": {"readonly": True}, - "activated_storage_count": {"readonly": True}, - "additional_storage_count": {"readonly": True}, - "display_name": {"required": True, "max_length": 255, "min_length": 1}, - "last_maintenance_run_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "next_maintenance_run_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "monthly_db_server_version": {"readonly": True}, - "monthly_storage_server_version": {"readonly": True}, - } - - _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "compute_count": {"key": "computeCount", "type": "int"}, - "storage_count": {"key": "storageCount", "type": "int"}, - "total_storage_size_in_gbs": {"key": "totalStorageSizeInGbs", "type": "int"}, - "available_storage_size_in_gbs": {"key": "availableStorageSizeInGbs", "type": "int"}, - "time_created": {"key": "timeCreated", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "maintenance_window": {"key": "maintenanceWindow", "type": "MaintenanceWindow"}, - "estimated_patching_time": {"key": "estimatedPatchingTime", "type": "EstimatedPatchingTime"}, - "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "shape": {"key": "shape", "type": "str"}, - "oci_url": {"key": "ociUrl", "type": "str"}, - "cpu_count": {"key": "cpuCount", "type": "int"}, - "max_cpu_count": {"key": "maxCpuCount", "type": "int"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "max_memory_in_gbs": {"key": "maxMemoryInGbs", "type": "int"}, - "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "max_db_node_storage_size_in_gbs": {"key": "maxDbNodeStorageSizeInGbs", "type": "int"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "float"}, - "max_data_storage_in_tbs": {"key": "maxDataStorageInTbs", "type": "float"}, - "db_server_version": {"key": "dbServerVersion", "type": "str"}, - "storage_server_version": {"key": "storageServerVersion", "type": "str"}, - "activated_storage_count": {"key": "activatedStorageCount", "type": "int"}, - "additional_storage_count": {"key": "additionalStorageCount", "type": "int"}, - "display_name": {"key": "displayName", "type": "str"}, - "last_maintenance_run_id": {"key": "lastMaintenanceRunId", "type": "str"}, - "next_maintenance_run_id": {"key": "nextMaintenanceRunId", "type": "str"}, - "monthly_db_server_version": {"key": "monthlyDbServerVersion", "type": "str"}, - "monthly_storage_server_version": {"key": "monthlyStorageServerVersion", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - shape: str, - display_name: str, - compute_count: Optional[int] = None, - storage_count: Optional[int] = None, - maintenance_window: Optional["_models.MaintenanceWindow"] = None, - customer_contacts: Optional[List["_models.CustomerContact"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword compute_count: The number of compute servers for the cloud Exadata infrastructure. - :paramtype compute_count: int - :keyword storage_count: The number of storage servers for the cloud Exadata infrastructure. - :paramtype storage_count: int - :keyword maintenance_window: maintenanceWindow property. - :paramtype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow - :keyword customer_contacts: The list of customer email addresses that receive information from - Oracle about the specified OCI Database service resource. Oracle uses these email addresses to - send notifications about planned and unplanned software maintenance updates, information about - system hardware, and other information needed by administrators. Up to 10 email addresses can - be added to the customer contacts for a cloud Exadata infrastructure instance. - :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :keyword shape: The model name of the cloud Exadata infrastructure resource. Required. - :paramtype shape: str - :keyword display_name: The name for the Exadata infrastructure. Required. - :paramtype display_name: str - """ - super().__init__(**kwargs) - self.ocid = None - self.compute_count = compute_count - self.storage_count = storage_count - self.total_storage_size_in_gbs = None - self.available_storage_size_in_gbs = None - self.time_created = None - self.lifecycle_details = None - self.maintenance_window = maintenance_window - self.estimated_patching_time = None - self.customer_contacts = customer_contacts - self.provisioning_state = None - self.lifecycle_state = None - self.shape = shape - self.oci_url = None - self.cpu_count = None - self.max_cpu_count = None - self.memory_size_in_gbs = None - self.max_memory_in_gbs = None - self.db_node_storage_size_in_gbs = None - self.max_db_node_storage_size_in_gbs = None - self.data_storage_size_in_tbs = None - self.max_data_storage_in_tbs = None - self.db_server_version = None - self.storage_server_version = None - self.activated_storage_count = None - self.additional_storage_count = None - self.display_name = display_name - self.last_maintenance_run_id = None - self.next_maintenance_run_id = None - self.monthly_db_server_version = None - self.monthly_storage_server_version = None - - -class CloudExadataInfrastructureUpdate(_serialization.Model): - """The type used for update operations of the CloudExadataInfrastructure. - - :ivar zones: CloudExadataInfrastructure zones. - :vartype zones: list[str] - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The updatable properties of the CloudExadataInfrastructure. - :vartype properties: - ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdateProperties - """ - - _attribute_map = { - "zones": {"key": "zones", "type": "[str]"}, - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "CloudExadataInfrastructureUpdateProperties"}, - } - - def __init__( - self, - *, - zones: Optional[List[str]] = None, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CloudExadataInfrastructureUpdateProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword zones: CloudExadataInfrastructure zones. - :paramtype zones: list[str] - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: The updatable properties of the CloudExadataInfrastructure. - :paramtype properties: - ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdateProperties - """ - super().__init__(**kwargs) - self.zones = zones - self.tags = tags - self.properties = properties - - -class CloudExadataInfrastructureUpdateProperties(_serialization.Model): # pylint: disable=name-too-long - """The updatable properties of the CloudExadataInfrastructure. - - :ivar compute_count: The number of compute servers for the cloud Exadata infrastructure. - :vartype compute_count: int - :ivar storage_count: The number of storage servers for the cloud Exadata infrastructure. - :vartype storage_count: int - :ivar maintenance_window: maintenanceWindow property. - :vartype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow - :ivar customer_contacts: The list of customer email addresses that receive information from - Oracle about the specified OCI Database service resource. Oracle uses these email addresses to - send notifications about planned and unplanned software maintenance updates, information about - system hardware, and other information needed by administrators. Up to 10 email addresses can - be added to the customer contacts for a cloud Exadata infrastructure instance. - :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :ivar display_name: The name for the Exadata infrastructure. - :vartype display_name: str - """ - - _validation = { - "display_name": {"max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "compute_count": {"key": "computeCount", "type": "int"}, - "storage_count": {"key": "storageCount", "type": "int"}, - "maintenance_window": {"key": "maintenanceWindow", "type": "MaintenanceWindow"}, - "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, - "display_name": {"key": "displayName", "type": "str"}, - } - - def __init__( - self, - *, - compute_count: Optional[int] = None, - storage_count: Optional[int] = None, - maintenance_window: Optional["_models.MaintenanceWindow"] = None, - customer_contacts: Optional[List["_models.CustomerContact"]] = None, - display_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword compute_count: The number of compute servers for the cloud Exadata infrastructure. - :paramtype compute_count: int - :keyword storage_count: The number of storage servers for the cloud Exadata infrastructure. - :paramtype storage_count: int - :keyword maintenance_window: maintenanceWindow property. - :paramtype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow - :keyword customer_contacts: The list of customer email addresses that receive information from - Oracle about the specified OCI Database service resource. Oracle uses these email addresses to - send notifications about planned and unplanned software maintenance updates, information about - system hardware, and other information needed by administrators. Up to 10 email addresses can - be added to the customer contacts for a cloud Exadata infrastructure instance. - :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :keyword display_name: The name for the Exadata infrastructure. - :paramtype display_name: str - """ - super().__init__(**kwargs) - self.compute_count = compute_count - self.storage_count = storage_count - self.maintenance_window = maintenance_window - self.customer_contacts = customer_contacts - self.display_name = display_name - - -class CloudVmCluster(TrackedResource): - """CloudVmCluster 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: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "CloudVmClusterProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CloudVmClusterProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class CloudVmClusterListResult(_serialization.Model): - """The response of a CloudVmCluster list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The CloudVmCluster items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[CloudVmCluster]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.CloudVmCluster"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The CloudVmCluster items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class CloudVmClusterProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """CloudVmCluster resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar ocid: Cloud VM Cluster ocid. - :vartype ocid: str - :ivar listener_port: The port number configured for the listener on the cloud VM cluster. - :vartype listener_port: int - :ivar node_count: The number of nodes in the cloud VM cluster. - :vartype node_count: int - :ivar storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. - :vartype storage_size_in_gbs: int - :ivar data_storage_size_in_tbs: The data disk group size to be allocated in TBs. - :vartype data_storage_size_in_tbs: float - :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. - :vartype db_node_storage_size_in_gbs: int - :ivar memory_size_in_gbs: The memory to be allocated in GBs. - :vartype memory_size_in_gbs: int - :ivar time_created: The date and time that the cloud VM cluster was created. - :vartype time_created: ~datetime.datetime - :ivar lifecycle_details: Additional information about the current lifecycle state. - :vartype lifecycle_details: str - :ivar time_zone: The time zone of the cloud VM cluster. For details, see `Exadata - Infrastructure Time Zones `_. - :vartype time_zone: str - :ivar zone_id: The OCID of the zone the cloud VM cluster is associated with. - :vartype zone_id: str - :ivar hostname: The hostname for the cloud VM cluster. Required. - :vartype hostname: str - :ivar domain: The domain name for the cloud VM cluster. - :vartype domain: str - :ivar cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. Required. - :vartype cpu_core_count: int - :ivar ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal - place is allowed for the fractional part. - :vartype ocpu_count: float - :ivar cluster_name: The cluster name for cloud VM cluster. The cluster name must begin with an - alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The - cluster name can be no longer than 11 characters and is not case sensitive. - :vartype cluster_name: str - :ivar data_storage_percentage: The percentage assigned to DATA storage (user data and database - files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, - and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default is 80 percent - assigned to DATA storage. See `Storage Configuration - `_ in the Exadata documentation for details - on the impact of the configuration settings on storage. - :vartype data_storage_percentage: int - :ivar is_local_backup_enabled: If true, database backup on local Exadata storage is configured - for the cloud VM cluster. If false, database backup on local Exadata storage is not available - in the cloud VM cluster. - :vartype is_local_backup_enabled: bool - :ivar cloud_exadata_infrastructure_id: Cloud Exadata Infrastructure ID. Required. - :vartype cloud_exadata_infrastructure_id: str - :ivar is_sparse_diskgroup_enabled: If true, sparse disk group is configured for the cloud VM - cluster. If false, sparse disk group is not created. - :vartype is_sparse_diskgroup_enabled: bool - :ivar system_version: Operating system version of the image. - :vartype system_version: str - :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to - the cloud VM cluster. Required. - :vartype ssh_public_keys: list[str] - :ivar license_model: The Oracle license model that applies to the cloud VM cluster. The default - is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :ivar disk_redundancy: The type of redundancy configured for the cloud Vm cluster. NORMAL is - 2-way redundancy. HIGH is 3-way redundancy. Known values are: "High" and "Normal". - :vartype disk_redundancy: str or ~azure.mgmt.oracledatabase.models.DiskRedundancy - :ivar scan_ip_ids: The Single Client Access Name (SCAN) IP addresses associated with the cloud - VM cluster. SCAN IP addresses are typically used for load balancing and are not assigned to any - interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. - **Note:** For a single-node DB system, this list is empty. - :vartype scan_ip_ids: list[str] - :ivar vip_ids: The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster - Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud - Service instance to enable failover. If one node fails, the VIP is reassigned to another active - node in the cluster. **Note:** For a single-node DB system, this list is empty. - :vartype vip_ids: list[str] - :ivar scan_dns_name: The FQDN of the DNS record for the SCAN IP addresses that are associated - with the cloud VM cluster. - :vartype scan_dns_name: str - :ivar scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default port - is 1521. - :vartype scan_listener_port_tcp: int - :ivar scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The default - port is 2484. - :vartype scan_listener_port_tcp_ssl: int - :ivar scan_dns_record_id: The OCID of the DNS record for the SCAN IP addresses that are - associated with the cloud VM cluster. - :vartype scan_dns_record_id: str - :ivar shape: The model name of the Exadata hardware running the cloud VM cluster. - :vartype shape: str - :ivar provisioning_state: CloudVmCluster provisioning state. Known values are: "Succeeded", - "Failed", "Canceled", and "Provisioning". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState - :ivar lifecycle_state: CloudVmCluster lifecycle state. Known values are: "Provisioning", - "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", and "Failed". - :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.CloudVmClusterLifecycleState - :ivar vnet_id: VNET for network connectivity. Required. - :vartype vnet_id: str - :ivar gi_version: Oracle Grid Infrastructure (GI) software version. Required. - :vartype gi_version: str - :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. - :vartype oci_url: str - :ivar nsg_url: HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure - Interface. - :vartype nsg_url: str - :ivar subnet_id: Client subnet. Required. - :vartype subnet_id: str - :ivar backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. - :vartype backup_subnet_cidr: str - :ivar nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision - the VM Cluster will be added by default. - :vartype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] - :ivar data_collection_options: Indicates user preferences for the various diagnostic collection - options for the VM cluster/Cloud VM cluster/VMBM DBCS. - :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions - :ivar display_name: Display Name. Required. - :vartype display_name: str - :ivar compute_nodes: The list of compute servers to be added to the cloud VM cluster. - :vartype compute_nodes: list[str] - :ivar iorm_config_cache: iormConfigCache details for cloud VM cluster. - :vartype iorm_config_cache: ~azure.mgmt.oracledatabase.models.ExadataIormConfig - :ivar last_update_history_entry_id: The OCID of the last maintenance update history entry. - :vartype last_update_history_entry_id: str - :ivar db_servers: The list of DB servers. - :vartype db_servers: list[str] - :ivar compartment_id: Cluster compartmentId. - :vartype compartment_id: str - :ivar subnet_ocid: Cluster subnet ocid. - :vartype subnet_ocid: str - """ - - _validation = { - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "listener_port": {"readonly": True}, - "node_count": {"readonly": True}, - "time_created": {"readonly": True}, - "lifecycle_details": {"readonly": True}, - "time_zone": {"max_length": 255, "min_length": 1}, - "zone_id": {"max_length": 255, "min_length": 1}, - "hostname": {"required": True, "max_length": 23, "min_length": 1}, - "cpu_core_count": {"required": True}, - "cluster_name": {"max_length": 11, "min_length": 1}, - "cloud_exadata_infrastructure_id": {"required": True}, - "system_version": {"max_length": 255, "min_length": 1}, - "ssh_public_keys": {"required": True}, - "disk_redundancy": {"readonly": True}, - "scan_ip_ids": {"readonly": True}, - "vip_ids": {"readonly": True}, - "scan_dns_name": {"readonly": True, "max_length": 72, "min_length": 1}, - "scan_dns_record_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "shape": {"readonly": True, "max_length": 255, "min_length": 1}, - "provisioning_state": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "vnet_id": {"required": True}, - "gi_version": {"required": True}, - "oci_url": {"readonly": True}, - "nsg_url": {"readonly": True}, - "subnet_id": {"required": True}, - "backup_subnet_cidr": {"max_length": 32, "min_length": 1}, - "display_name": {"required": True, "max_length": 255, "min_length": 1}, - "iorm_config_cache": {"readonly": True}, - "last_update_history_entry_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "compartment_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "subnet_ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "listener_port": {"key": "listenerPort", "type": "int"}, - "node_count": {"key": "nodeCount", "type": "int"}, - "storage_size_in_gbs": {"key": "storageSizeInGbs", "type": "int"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "float"}, - "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "time_zone": {"key": "timeZone", "type": "str"}, - "zone_id": {"key": "zoneId", "type": "str"}, - "hostname": {"key": "hostname", "type": "str"}, - "domain": {"key": "domain", "type": "str"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "ocpu_count": {"key": "ocpuCount", "type": "float"}, - "cluster_name": {"key": "clusterName", "type": "str"}, - "data_storage_percentage": {"key": "dataStoragePercentage", "type": "int"}, - "is_local_backup_enabled": {"key": "isLocalBackupEnabled", "type": "bool"}, - "cloud_exadata_infrastructure_id": {"key": "cloudExadataInfrastructureId", "type": "str"}, - "is_sparse_diskgroup_enabled": {"key": "isSparseDiskgroupEnabled", "type": "bool"}, - "system_version": {"key": "systemVersion", "type": "str"}, - "ssh_public_keys": {"key": "sshPublicKeys", "type": "[str]"}, - "license_model": {"key": "licenseModel", "type": "str"}, - "disk_redundancy": {"key": "diskRedundancy", "type": "str"}, - "scan_ip_ids": {"key": "scanIpIds", "type": "[str]"}, - "vip_ids": {"key": "vipIds", "type": "[str]"}, - "scan_dns_name": {"key": "scanDnsName", "type": "str"}, - "scan_listener_port_tcp": {"key": "scanListenerPortTcp", "type": "int"}, - "scan_listener_port_tcp_ssl": {"key": "scanListenerPortTcpSsl", "type": "int"}, - "scan_dns_record_id": {"key": "scanDnsRecordId", "type": "str"}, - "shape": {"key": "shape", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "vnet_id": {"key": "vnetId", "type": "str"}, - "gi_version": {"key": "giVersion", "type": "str"}, - "oci_url": {"key": "ociUrl", "type": "str"}, - "nsg_url": {"key": "nsgUrl", "type": "str"}, - "subnet_id": {"key": "subnetId", "type": "str"}, - "backup_subnet_cidr": {"key": "backupSubnetCidr", "type": "str"}, - "nsg_cidrs": {"key": "nsgCidrs", "type": "[NsgCidr]"}, - "data_collection_options": {"key": "dataCollectionOptions", "type": "DataCollectionOptions"}, - "display_name": {"key": "displayName", "type": "str"}, - "compute_nodes": {"key": "computeNodes", "type": "[str]"}, - "iorm_config_cache": {"key": "iormConfigCache", "type": "ExadataIormConfig"}, - "last_update_history_entry_id": {"key": "lastUpdateHistoryEntryId", "type": "str"}, - "db_servers": {"key": "dbServers", "type": "[str]"}, - "compartment_id": {"key": "compartmentId", "type": "str"}, - "subnet_ocid": {"key": "subnetOcid", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - hostname: str, - cpu_core_count: int, - cloud_exadata_infrastructure_id: str, - ssh_public_keys: List[str], - vnet_id: str, - gi_version: str, - subnet_id: str, - display_name: str, - storage_size_in_gbs: Optional[int] = None, - data_storage_size_in_tbs: Optional[float] = None, - db_node_storage_size_in_gbs: Optional[int] = None, - memory_size_in_gbs: Optional[int] = None, - time_zone: Optional[str] = None, - zone_id: Optional[str] = None, - domain: Optional[str] = None, - ocpu_count: Optional[float] = None, - cluster_name: Optional[str] = None, - data_storage_percentage: Optional[int] = None, - is_local_backup_enabled: bool = False, - is_sparse_diskgroup_enabled: bool = False, - system_version: Optional[str] = None, - license_model: Optional[Union[str, "_models.LicenseModel"]] = None, - scan_listener_port_tcp: Optional[int] = None, - scan_listener_port_tcp_ssl: Optional[int] = None, - backup_subnet_cidr: Optional[str] = None, - nsg_cidrs: Optional[List["_models.NsgCidr"]] = None, - data_collection_options: Optional["_models.DataCollectionOptions"] = None, - compute_nodes: Optional[List[str]] = None, - db_servers: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. - :paramtype storage_size_in_gbs: int - :keyword data_storage_size_in_tbs: The data disk group size to be allocated in TBs. - :paramtype data_storage_size_in_tbs: float - :keyword db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. - :paramtype db_node_storage_size_in_gbs: int - :keyword memory_size_in_gbs: The memory to be allocated in GBs. - :paramtype memory_size_in_gbs: int - :keyword time_zone: The time zone of the cloud VM cluster. For details, see `Exadata - Infrastructure Time Zones `_. - :paramtype time_zone: str - :keyword zone_id: The OCID of the zone the cloud VM cluster is associated with. - :paramtype zone_id: str - :keyword hostname: The hostname for the cloud VM cluster. Required. - :paramtype hostname: str - :keyword domain: The domain name for the cloud VM cluster. - :paramtype domain: str - :keyword cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. Required. - :paramtype cpu_core_count: int - :keyword ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal - place is allowed for the fractional part. - :paramtype ocpu_count: float - :keyword cluster_name: The cluster name for cloud VM cluster. The cluster name must begin with - an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The - cluster name can be no longer than 11 characters and is not case sensitive. - :paramtype cluster_name: str - :keyword data_storage_percentage: The percentage assigned to DATA storage (user data and - database files). The remaining percentage is assigned to RECO storage (database redo logs, - archive logs, and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default - is 80 percent assigned to DATA storage. See `Storage Configuration - `_ in the Exadata documentation for details - on the impact of the configuration settings on storage. - :paramtype data_storage_percentage: int - :keyword is_local_backup_enabled: If true, database backup on local Exadata storage is - configured for the cloud VM cluster. If false, database backup on local Exadata storage is not - available in the cloud VM cluster. - :paramtype is_local_backup_enabled: bool - :keyword cloud_exadata_infrastructure_id: Cloud Exadata Infrastructure ID. Required. - :paramtype cloud_exadata_infrastructure_id: str - :keyword is_sparse_diskgroup_enabled: If true, sparse disk group is configured for the cloud VM - cluster. If false, sparse disk group is not created. - :paramtype is_sparse_diskgroup_enabled: bool - :keyword system_version: Operating system version of the image. - :paramtype system_version: str - :keyword ssh_public_keys: The public key portion of one or more key pairs used for SSH access - to the cloud VM cluster. Required. - :paramtype ssh_public_keys: list[str] - :keyword license_model: The Oracle license model that applies to the cloud VM cluster. The - default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :keyword scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default - port is 1521. - :paramtype scan_listener_port_tcp: int - :keyword scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The - default port is 2484. - :paramtype scan_listener_port_tcp_ssl: int - :keyword vnet_id: VNET for network connectivity. Required. - :paramtype vnet_id: str - :keyword gi_version: Oracle Grid Infrastructure (GI) software version. Required. - :paramtype gi_version: str - :keyword subnet_id: Client subnet. Required. - :paramtype subnet_id: str - :keyword backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. - :paramtype backup_subnet_cidr: str - :keyword nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to - provision the VM Cluster will be added by default. - :paramtype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] - :keyword data_collection_options: Indicates user preferences for the various diagnostic - collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. - :paramtype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions - :keyword display_name: Display Name. Required. - :paramtype display_name: str - :keyword compute_nodes: The list of compute servers to be added to the cloud VM cluster. - :paramtype compute_nodes: list[str] - :keyword db_servers: The list of DB servers. - :paramtype db_servers: list[str] - """ - super().__init__(**kwargs) - self.ocid = None - self.listener_port = None - self.node_count = None - self.storage_size_in_gbs = storage_size_in_gbs - self.data_storage_size_in_tbs = data_storage_size_in_tbs - self.db_node_storage_size_in_gbs = db_node_storage_size_in_gbs - self.memory_size_in_gbs = memory_size_in_gbs - self.time_created = None - self.lifecycle_details = None - self.time_zone = time_zone - self.zone_id = zone_id - self.hostname = hostname - self.domain = domain - self.cpu_core_count = cpu_core_count - self.ocpu_count = ocpu_count - self.cluster_name = cluster_name - self.data_storage_percentage = data_storage_percentage - self.is_local_backup_enabled = is_local_backup_enabled - self.cloud_exadata_infrastructure_id = cloud_exadata_infrastructure_id - self.is_sparse_diskgroup_enabled = is_sparse_diskgroup_enabled - self.system_version = system_version - self.ssh_public_keys = ssh_public_keys - self.license_model = license_model - self.disk_redundancy = None - self.scan_ip_ids = None - self.vip_ids = None - self.scan_dns_name = None - self.scan_listener_port_tcp = scan_listener_port_tcp - self.scan_listener_port_tcp_ssl = scan_listener_port_tcp_ssl - self.scan_dns_record_id = None - self.shape = None - self.provisioning_state = None - self.lifecycle_state = None - self.vnet_id = vnet_id - self.gi_version = gi_version - self.oci_url = None - self.nsg_url = None - self.subnet_id = subnet_id - self.backup_subnet_cidr = backup_subnet_cidr - self.nsg_cidrs = nsg_cidrs - self.data_collection_options = data_collection_options - self.display_name = display_name - self.compute_nodes = compute_nodes - self.iorm_config_cache = None - self.last_update_history_entry_id = None - self.db_servers = db_servers - self.compartment_id = None - self.subnet_ocid = None - - -class CloudVmClusterUpdate(_serialization.Model): - """The type used for update operations of the CloudVmCluster. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The updatable properties of the CloudVmCluster. - :vartype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdateProperties - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "CloudVmClusterUpdateProperties"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CloudVmClusterUpdateProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: The updatable properties of the CloudVmCluster. - :paramtype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdateProperties - """ - super().__init__(**kwargs) - self.tags = tags - self.properties = properties - - -class CloudVmClusterUpdateProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The updatable properties of the CloudVmCluster. - - :ivar storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. - :vartype storage_size_in_gbs: int - :ivar data_storage_size_in_tbs: The data disk group size to be allocated in TBs. - :vartype data_storage_size_in_tbs: float - :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. - :vartype db_node_storage_size_in_gbs: int - :ivar memory_size_in_gbs: The memory to be allocated in GBs. - :vartype memory_size_in_gbs: int - :ivar cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. - :vartype cpu_core_count: int - :ivar ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal - place is allowed for the fractional part. - :vartype ocpu_count: float - :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to - the cloud VM cluster. - :vartype ssh_public_keys: list[str] - :ivar license_model: The Oracle license model that applies to the cloud VM cluster. The default - is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :ivar data_collection_options: Indicates user preferences for the various diagnostic collection - options for the VM cluster/Cloud VM cluster/VMBM DBCS. - :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions - :ivar display_name: Display Name. - :vartype display_name: str - :ivar compute_nodes: The list of compute servers to be added to the cloud VM cluster. - :vartype compute_nodes: list[str] - """ - - _validation = { - "display_name": {"max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "storage_size_in_gbs": {"key": "storageSizeInGbs", "type": "int"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "float"}, - "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "ocpu_count": {"key": "ocpuCount", "type": "float"}, - "ssh_public_keys": {"key": "sshPublicKeys", "type": "[str]"}, - "license_model": {"key": "licenseModel", "type": "str"}, - "data_collection_options": {"key": "dataCollectionOptions", "type": "DataCollectionOptions"}, - "display_name": {"key": "displayName", "type": "str"}, - "compute_nodes": {"key": "computeNodes", "type": "[str]"}, - } - - def __init__( - self, - *, - storage_size_in_gbs: Optional[int] = None, - data_storage_size_in_tbs: Optional[float] = None, - db_node_storage_size_in_gbs: Optional[int] = None, - memory_size_in_gbs: Optional[int] = None, - cpu_core_count: Optional[int] = None, - ocpu_count: Optional[float] = None, - ssh_public_keys: Optional[List[str]] = None, - license_model: Optional[Union[str, "_models.LicenseModel"]] = None, - data_collection_options: Optional["_models.DataCollectionOptions"] = None, - display_name: Optional[str] = None, - compute_nodes: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. - :paramtype storage_size_in_gbs: int - :keyword data_storage_size_in_tbs: The data disk group size to be allocated in TBs. - :paramtype data_storage_size_in_tbs: float - :keyword db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. - :paramtype db_node_storage_size_in_gbs: int - :keyword memory_size_in_gbs: The memory to be allocated in GBs. - :paramtype memory_size_in_gbs: int - :keyword cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. - :paramtype cpu_core_count: int - :keyword ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal - place is allowed for the fractional part. - :paramtype ocpu_count: float - :keyword ssh_public_keys: The public key portion of one or more key pairs used for SSH access - to the cloud VM cluster. - :paramtype ssh_public_keys: list[str] - :keyword license_model: The Oracle license model that applies to the cloud VM cluster. The - default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :keyword data_collection_options: Indicates user preferences for the various diagnostic - collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. - :paramtype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions - :keyword display_name: Display Name. - :paramtype display_name: str - :keyword compute_nodes: The list of compute servers to be added to the cloud VM cluster. - :paramtype compute_nodes: list[str] - """ - super().__init__(**kwargs) - self.storage_size_in_gbs = storage_size_in_gbs - self.data_storage_size_in_tbs = data_storage_size_in_tbs - self.db_node_storage_size_in_gbs = db_node_storage_size_in_gbs - self.memory_size_in_gbs = memory_size_in_gbs - self.cpu_core_count = cpu_core_count - self.ocpu_count = ocpu_count - self.ssh_public_keys = ssh_public_keys - self.license_model = license_model - self.data_collection_options = data_collection_options - self.display_name = display_name - self.compute_nodes = compute_nodes - - -class ConnectionStringType(_serialization.Model): - """Connection strings to connect to an Oracle Autonomous Database. - - :ivar all_connection_strings: Returns all connection strings that can be used to connect to the - Autonomous Database. - :vartype all_connection_strings: ~azure.mgmt.oracledatabase.models.AllConnectionStringType - :ivar dedicated: The database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :vartype dedicated: str - :ivar high: The High database service provides the highest level of resources to each SQL - statement resulting in the highest performance, but supports the fewest number of concurrent - SQL statements. - :vartype high: str - :ivar low: The Low database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :vartype low: str - :ivar medium: The Medium database service provides a lower level of resources to each SQL - statement potentially resulting a lower level of performance, but supports more concurrent SQL - statements. - :vartype medium: str - :ivar profiles: A list of connection string profiles to allow clients to group, filter and - select connection string values based on structured metadata. - :vartype profiles: list[~azure.mgmt.oracledatabase.models.ProfileType] - """ - - _validation = { - "dedicated": {"max_length": 255, "min_length": 10}, - "high": {"max_length": 255, "min_length": 10}, - "low": {"max_length": 255, "min_length": 10}, - "medium": {"max_length": 255, "min_length": 10}, - } - - _attribute_map = { - "all_connection_strings": {"key": "allConnectionStrings", "type": "AllConnectionStringType"}, - "dedicated": {"key": "dedicated", "type": "str"}, - "high": {"key": "high", "type": "str"}, - "low": {"key": "low", "type": "str"}, - "medium": {"key": "medium", "type": "str"}, - "profiles": {"key": "profiles", "type": "[ProfileType]"}, - } - - def __init__( - self, - *, - all_connection_strings: Optional["_models.AllConnectionStringType"] = None, - dedicated: Optional[str] = None, - high: Optional[str] = None, - low: Optional[str] = None, - medium: Optional[str] = None, - profiles: Optional[List["_models.ProfileType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword all_connection_strings: Returns all connection strings that can be used to connect to - the Autonomous Database. - :paramtype all_connection_strings: ~azure.mgmt.oracledatabase.models.AllConnectionStringType - :keyword dedicated: The database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :paramtype dedicated: str - :keyword high: The High database service provides the highest level of resources to each SQL - statement resulting in the highest performance, but supports the fewest number of concurrent - SQL statements. - :paramtype high: str - :keyword low: The Low database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :paramtype low: str - :keyword medium: The Medium database service provides a lower level of resources to each SQL - statement potentially resulting a lower level of performance, but supports more concurrent SQL - statements. - :paramtype medium: str - :keyword profiles: A list of connection string profiles to allow clients to group, filter and - select connection string values based on structured metadata. - :paramtype profiles: list[~azure.mgmt.oracledatabase.models.ProfileType] - """ - super().__init__(**kwargs) - self.all_connection_strings = all_connection_strings - self.dedicated = dedicated - self.high = high - self.low = low - self.medium = medium - self.profiles = profiles - - -class ConnectionUrlType(_serialization.Model): - """The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser - from a Compute instance within your VCN or that has a direct connection to your VCN. - - :ivar apex_url: Oracle Application Express (APEX) URL. - :vartype apex_url: str - :ivar database_transforms_url: The URL of the Database Transforms for the Autonomous Database. - :vartype database_transforms_url: str - :ivar graph_studio_url: The URL of the Graph Studio for the Autonomous Database. - :vartype graph_studio_url: str - :ivar machine_learning_notebook_url: The URL of the Oracle Machine Learning (OML) Notebook for - the Autonomous Database. - :vartype machine_learning_notebook_url: str - :ivar mongo_db_url: The URL of the MongoDB API for the Autonomous Database. - :vartype mongo_db_url: str - :ivar ords_url: The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous - Database. - :vartype ords_url: str - :ivar sql_dev_web_url: Oracle SQL Developer Web URL. - :vartype sql_dev_web_url: str - """ - - _validation = { - "apex_url": {"max_length": 512, "min_length": 10}, - "database_transforms_url": {"max_length": 512, "min_length": 10}, - "graph_studio_url": {"max_length": 512, "min_length": 10}, - "machine_learning_notebook_url": {"max_length": 512, "min_length": 10}, - "mongo_db_url": {"max_length": 512, "min_length": 10}, - "ords_url": {"max_length": 512, "min_length": 10}, - "sql_dev_web_url": {"max_length": 512, "min_length": 10}, - } - - _attribute_map = { - "apex_url": {"key": "apexUrl", "type": "str"}, - "database_transforms_url": {"key": "databaseTransformsUrl", "type": "str"}, - "graph_studio_url": {"key": "graphStudioUrl", "type": "str"}, - "machine_learning_notebook_url": {"key": "machineLearningNotebookUrl", "type": "str"}, - "mongo_db_url": {"key": "mongoDbUrl", "type": "str"}, - "ords_url": {"key": "ordsUrl", "type": "str"}, - "sql_dev_web_url": {"key": "sqlDevWebUrl", "type": "str"}, - } - - def __init__( - self, - *, - apex_url: Optional[str] = None, - database_transforms_url: Optional[str] = None, - graph_studio_url: Optional[str] = None, - machine_learning_notebook_url: Optional[str] = None, - mongo_db_url: Optional[str] = None, - ords_url: Optional[str] = None, - sql_dev_web_url: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword apex_url: Oracle Application Express (APEX) URL. - :paramtype apex_url: str - :keyword database_transforms_url: The URL of the Database Transforms for the Autonomous - Database. - :paramtype database_transforms_url: str - :keyword graph_studio_url: The URL of the Graph Studio for the Autonomous Database. - :paramtype graph_studio_url: str - :keyword machine_learning_notebook_url: The URL of the Oracle Machine Learning (OML) Notebook - for the Autonomous Database. - :paramtype machine_learning_notebook_url: str - :keyword mongo_db_url: The URL of the MongoDB API for the Autonomous Database. - :paramtype mongo_db_url: str - :keyword ords_url: The Oracle REST Data Services (ORDS) URL of the Web Access for the - Autonomous Database. - :paramtype ords_url: str - :keyword sql_dev_web_url: Oracle SQL Developer Web URL. - :paramtype sql_dev_web_url: str - """ - super().__init__(**kwargs) - self.apex_url = apex_url - self.database_transforms_url = database_transforms_url - self.graph_studio_url = graph_studio_url - self.machine_learning_notebook_url = machine_learning_notebook_url - self.mongo_db_url = mongo_db_url - self.ords_url = ords_url - self.sql_dev_web_url = sql_dev_web_url - - -class CustomerContact(_serialization.Model): - """CustomerContact resource properties. - - All required parameters must be populated in order to send to server. - - :ivar email: The email address used by Oracle to send notifications regarding databases and - infrastructure. Required. - :vartype email: str - """ - - _validation = { - "email": {"required": True, "max_length": 320, "min_length": 1}, - } - - _attribute_map = { - "email": {"key": "email", "type": "str"}, - } - - def __init__(self, *, email: str, **kwargs: Any) -> None: - """ - :keyword email: The email address used by Oracle to send notifications regarding databases and - infrastructure. Required. - :paramtype email: str - """ - super().__init__(**kwargs) - self.email = email - - -class DataCollectionOptions(_serialization.Model): - """DataCollectionOptions resource properties. - - :ivar is_diagnostics_events_enabled: Indicates whether diagnostic collection is enabled for the - VM cluster/Cloud VM cluster/VMBM DBCS. - :vartype is_diagnostics_events_enabled: bool - :ivar is_health_monitoring_enabled: Indicates whether health monitoring is enabled for the VM - cluster / Cloud VM cluster / VMBM DBCS. - :vartype is_health_monitoring_enabled: bool - :ivar is_incident_logs_enabled: Indicates whether incident logs and trace collection are - enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. - :vartype is_incident_logs_enabled: bool - """ - - _attribute_map = { - "is_diagnostics_events_enabled": {"key": "isDiagnosticsEventsEnabled", "type": "bool"}, - "is_health_monitoring_enabled": {"key": "isHealthMonitoringEnabled", "type": "bool"}, - "is_incident_logs_enabled": {"key": "isIncidentLogsEnabled", "type": "bool"}, - } - - def __init__( - self, - *, - is_diagnostics_events_enabled: bool = False, - is_health_monitoring_enabled: bool = False, - is_incident_logs_enabled: bool = False, - **kwargs: Any - ) -> None: - """ - :keyword is_diagnostics_events_enabled: Indicates whether diagnostic collection is enabled for - the VM cluster/Cloud VM cluster/VMBM DBCS. - :paramtype is_diagnostics_events_enabled: bool - :keyword is_health_monitoring_enabled: Indicates whether health monitoring is enabled for the - VM cluster / Cloud VM cluster / VMBM DBCS. - :paramtype is_health_monitoring_enabled: bool - :keyword is_incident_logs_enabled: Indicates whether incident logs and trace collection are - enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. - :paramtype is_incident_logs_enabled: bool - """ - super().__init__(**kwargs) - self.is_diagnostics_events_enabled = is_diagnostics_events_enabled - self.is_health_monitoring_enabled = is_health_monitoring_enabled - self.is_incident_logs_enabled = is_incident_logs_enabled - - -class DayOfWeek(_serialization.Model): - """DayOfWeek resource properties. - - All required parameters must be populated in order to send to server. - - :ivar name: Name of the day of the week. Required. Known values are: "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". - :vartype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - } - - def __init__(self, *, name: Union[str, "_models.DayOfWeekName"], **kwargs: Any) -> None: - """ - :keyword name: Name of the day of the week. Required. Known values are: "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". - :paramtype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName - """ - super().__init__(**kwargs) - self.name = name - - -class DayOfWeekUpdate(_serialization.Model): - """DayOfWeek resource properties. - - :ivar name: Name of the day of the week. Known values are: "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday", and "Sunday". - :vartype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - } - - def __init__(self, *, name: Optional[Union[str, "_models.DayOfWeekName"]] = None, **kwargs: Any) -> None: - """ - :keyword name: Name of the day of the week. Known values are: "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday", and "Sunday". - :paramtype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName - """ - super().__init__(**kwargs) - self.name = name - - -class DbIormConfig(_serialization.Model): - """DbIormConfig for cloud vm cluster. - - :ivar db_name: The database name. For the default DbPlan, the dbName is default. - :vartype db_name: str - :ivar flash_cache_limit: The flash cache limit for this database. This value is internally - configured based on the share value assigned to the database. - :vartype flash_cache_limit: str - :ivar share: The relative priority of this database. - :vartype share: int - """ - - _validation = { - "share": {"maximum": 32, "minimum": 1}, - } - - _attribute_map = { - "db_name": {"key": "dbName", "type": "str"}, - "flash_cache_limit": {"key": "flashCacheLimit", "type": "str"}, - "share": {"key": "share", "type": "int"}, - } - - def __init__( - self, - *, - db_name: Optional[str] = None, - flash_cache_limit: Optional[str] = None, - share: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword db_name: The database name. For the default DbPlan, the dbName is default. - :paramtype db_name: str - :keyword flash_cache_limit: The flash cache limit for this database. This value is internally - configured based on the share value assigned to the database. - :paramtype flash_cache_limit: str - :keyword share: The relative priority of this database. - :paramtype share: int - """ - super().__init__(**kwargs) - self.db_name = db_name - self.flash_cache_limit = flash_cache_limit - self.share = share - - -class DbNode(ProxyResource): - """The DbNode resource belonging to vmCluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DbNodeProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DbNodeProperties"}, - } - - def __init__(self, *, properties: Optional["_models.DbNodeProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DbNodeProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class DbNodeAction(_serialization.Model): - """DbNode action object. - - All required parameters must be populated in order to send to server. - - :ivar action: Db action. Required. Known values are: "Start", "Stop", "SoftReset", and "Reset". - :vartype action: str or ~azure.mgmt.oracledatabase.models.DbNodeActionEnum - """ - - _validation = { - "action": {"required": True}, - } - - _attribute_map = { - "action": {"key": "action", "type": "str"}, - } - - def __init__(self, *, action: Union[str, "_models.DbNodeActionEnum"], **kwargs: Any) -> None: - """ - :keyword action: Db action. Required. Known values are: "Start", "Stop", "SoftReset", and - "Reset". - :paramtype action: str or ~azure.mgmt.oracledatabase.models.DbNodeActionEnum - """ - super().__init__(**kwargs) - self.action = action - - -class DbNodeListResult(_serialization.Model): - """The response of a DbNode list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The DbNode items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DbNode] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DbNode]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DbNode"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The DbNode items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DbNode] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DbNodeProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The properties of DbNodeResource. - - 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 ocid: DbNode OCID. Required. - :vartype ocid: str - :ivar additional_details: Additional information about the planned maintenance. - :vartype additional_details: str - :ivar backup_ip_id: The OCID of the backup IP address associated with the database node. - :vartype backup_ip_id: str - :ivar backup_vnic2_id: The OCID of the second backup VNIC. - :vartype backup_vnic2_id: str - :ivar backup_vnic_id: The OCID of the backup VNIC. - :vartype backup_vnic_id: str - :ivar cpu_core_count: The number of CPU cores enabled on the Db node. - :vartype cpu_core_count: int - :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db node. - :vartype db_node_storage_size_in_gbs: int - :ivar db_server_id: The OCID of the Exacc Db server associated with the database node. - :vartype db_server_id: str - :ivar db_system_id: The OCID of the DB system. Required. - :vartype db_system_id: str - :ivar fault_domain: The name of the Fault Domain the instance is contained in. - :vartype fault_domain: str - :ivar host_ip_id: The OCID of the host IP address associated with the database node. - :vartype host_ip_id: str - :ivar hostname: The host name for the database node. - :vartype hostname: str - :ivar lifecycle_state: The current state of the database node. Known values are: - "Provisioning", "Available", "Updating", "Stopping", "Stopped", "Starting", "Terminating", - "Terminated", and "Failed". - :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbNodeProvisioningState - :ivar lifecycle_details: Lifecycle details of Db Node. - :vartype lifecycle_details: str - :ivar maintenance_type: The type of database node maintenance. "VmdbRebootMigration" - :vartype maintenance_type: str or ~azure.mgmt.oracledatabase.models.DbNodeMaintenanceType - :ivar memory_size_in_gbs: The allocated memory in GBs on the Db node. - :vartype memory_size_in_gbs: int - :ivar software_storage_size_in_gb: The size (in GB) of the block storage volume allocation for - the DB system. This attribute applies only for virtual machine DB systems. - :vartype software_storage_size_in_gb: int - :ivar time_created: The date and time that the database node was created. - :vartype time_created: ~datetime.datetime - :ivar time_maintenance_window_end: End date and time of maintenance window. - :vartype time_maintenance_window_end: ~datetime.datetime - :ivar time_maintenance_window_start: Start date and time of maintenance window. - :vartype time_maintenance_window_start: ~datetime.datetime - :ivar vnic2_id: The OCID of the second VNIC. - :vartype vnic2_id: str - :ivar vnic_id: The OCID of the VNIC. - :vartype vnic_id: str - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState - """ - - _validation = { - "ocid": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "additional_details": {"readonly": True}, - "backup_ip_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "backup_vnic2_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "backup_vnic_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "cpu_core_count": {"readonly": True}, - "db_node_storage_size_in_gbs": {"readonly": True}, - "db_server_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "db_system_id": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "fault_domain": {"readonly": True, "max_length": 255, "min_length": 1}, - "host_ip_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "hostname": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "lifecycle_details": {"readonly": True}, - "maintenance_type": {"readonly": True}, - "memory_size_in_gbs": {"readonly": True}, - "software_storage_size_in_gb": {"readonly": True}, - "time_created": {"readonly": True}, - "time_maintenance_window_end": {"readonly": True}, - "time_maintenance_window_start": {"readonly": True}, - "vnic2_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "vnic_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "additional_details": {"key": "additionalDetails", "type": "str"}, - "backup_ip_id": {"key": "backupIpId", "type": "str"}, - "backup_vnic2_id": {"key": "backupVnic2Id", "type": "str"}, - "backup_vnic_id": {"key": "backupVnicId", "type": "str"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "db_server_id": {"key": "dbServerId", "type": "str"}, - "db_system_id": {"key": "dbSystemId", "type": "str"}, - "fault_domain": {"key": "faultDomain", "type": "str"}, - "host_ip_id": {"key": "hostIpId", "type": "str"}, - "hostname": {"key": "hostname", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "maintenance_type": {"key": "maintenanceType", "type": "str"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "software_storage_size_in_gb": {"key": "softwareStorageSizeInGb", "type": "int"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "time_maintenance_window_end": {"key": "timeMaintenanceWindowEnd", "type": "iso-8601"}, - "time_maintenance_window_start": {"key": "timeMaintenanceWindowStart", "type": "iso-8601"}, - "vnic2_id": {"key": "vnic2Id", "type": "str"}, - "vnic_id": {"key": "vnicId", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.ocid = None - self.additional_details = None - self.backup_ip_id = None - self.backup_vnic2_id = None - self.backup_vnic_id = None - self.cpu_core_count = None - self.db_node_storage_size_in_gbs = None - self.db_server_id = None - self.db_system_id = None - self.fault_domain = None - self.host_ip_id = None - self.hostname = None - self.lifecycle_state = None - self.lifecycle_details = None - self.maintenance_type = None - self.memory_size_in_gbs = None - self.software_storage_size_in_gb = None - self.time_created = None - self.time_maintenance_window_end = None - self.time_maintenance_window_start = None - self.vnic2_id = None - self.vnic_id = None - self.provisioning_state = None - - -class DbServer(ProxyResource): - """DbServer resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DbServerProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DbServerProperties"}, - } - - def __init__(self, *, properties: Optional["_models.DbServerProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DbServerProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class DbServerListResult(_serialization.Model): - """The response of a DbServer list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The DbServer items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DbServer] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DbServer]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DbServer"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The DbServer items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DbServer] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DbServerPatchingDetails(_serialization.Model): - """DbServer Patching Properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar estimated_patch_duration: Estimated Patch Duration. - :vartype estimated_patch_duration: int - :ivar patching_status: Patching Status. Known values are: "Scheduled", "MaintenanceInProgress", - "Failed", and "Complete". - :vartype patching_status: str or ~azure.mgmt.oracledatabase.models.DbServerPatchingStatus - :ivar time_patching_ended: Time Patching Ended. - :vartype time_patching_ended: ~datetime.datetime - :ivar time_patching_started: Time Patching Started. - :vartype time_patching_started: ~datetime.datetime - """ - - _validation = { - "estimated_patch_duration": {"readonly": True, "maximum": 3000, "minimum": 1}, - "patching_status": {"readonly": True}, - "time_patching_ended": {"readonly": True}, - "time_patching_started": {"readonly": True}, - } - - _attribute_map = { - "estimated_patch_duration": {"key": "estimatedPatchDuration", "type": "int"}, - "patching_status": {"key": "patchingStatus", "type": "str"}, - "time_patching_ended": {"key": "timePatchingEnded", "type": "iso-8601"}, - "time_patching_started": {"key": "timePatchingStarted", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.estimated_patch_duration = None - self.patching_status = None - self.time_patching_ended = None - self.time_patching_started = None - - -class DbServerProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """DbServer resource properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ocid: Db server name. - :vartype ocid: str - :ivar display_name: The name for the Db Server. - :vartype display_name: str - :ivar compartment_id: The OCID of the compartment. - :vartype compartment_id: str - :ivar exadata_infrastructure_id: The OCID of the Exadata infrastructure. - :vartype exadata_infrastructure_id: str - :ivar cpu_core_count: The number of CPU cores enabled on the Db server. - :vartype cpu_core_count: int - :ivar db_server_patching_details: dbServerPatching details of the Db server. - :vartype db_server_patching_details: ~azure.mgmt.oracledatabase.models.DbServerPatchingDetails - :ivar max_memory_in_gbs: The total memory available in GBs. - :vartype max_memory_in_gbs: int - :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db server. - :vartype db_node_storage_size_in_gbs: int - :ivar vm_cluster_ids: The OCID of the VM Clusters associated with the Db server. - :vartype vm_cluster_ids: list[str] - :ivar db_node_ids: The OCID of the Db nodes associated with the Db server. - :vartype db_node_ids: list[str] - :ivar lifecycle_details: Lifecycle details of dbServer. - :vartype lifecycle_details: str - :ivar lifecycle_state: DbServer provisioning state. Known values are: "Creating", "Available", - "Unavailable", "Deleting", "Deleted", and "MaintenanceInProgress". - :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbServerProvisioningState - :ivar max_cpu_count: The total number of CPU cores available. - :vartype max_cpu_count: int - :ivar autonomous_vm_cluster_ids: The list of OCIDs of the Autonomous VM Clusters associated - with the Db server. - :vartype autonomous_vm_cluster_ids: list[str] - :ivar autonomous_virtual_machine_ids: The list of OCIDs of the Autonomous Virtual Machines - associated with the Db server. - :vartype autonomous_virtual_machine_ids: list[str] - :ivar max_db_node_storage_in_gbs: The total max dbNode storage in GBs. - :vartype max_db_node_storage_in_gbs: int - :ivar memory_size_in_gbs: The total memory size in GBs. - :vartype memory_size_in_gbs: int - :ivar shape: The shape of the Db server. The shape determines the amount of CPU, storage, and - memory resources available. - :vartype shape: str - :ivar time_created: The date and time that the Db Server was created. - :vartype time_created: ~datetime.datetime - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState - """ - - _validation = { - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "display_name": {"readonly": True, "max_length": 255, "min_length": 1}, - "compartment_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "exadata_infrastructure_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "cpu_core_count": {"readonly": True}, - "db_server_patching_details": {"readonly": True}, - "max_memory_in_gbs": {"readonly": True}, - "db_node_storage_size_in_gbs": {"readonly": True}, - "vm_cluster_ids": {"readonly": True}, - "db_node_ids": {"readonly": True}, - "lifecycle_details": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "max_cpu_count": {"readonly": True}, - "autonomous_vm_cluster_ids": {"readonly": True}, - "autonomous_virtual_machine_ids": {"readonly": True}, - "max_db_node_storage_in_gbs": {"readonly": True}, - "memory_size_in_gbs": {"readonly": True}, - "shape": {"readonly": True, "max_length": 255, "min_length": 1}, - "time_created": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "compartment_id": {"key": "compartmentId", "type": "str"}, - "exadata_infrastructure_id": {"key": "exadataInfrastructureId", "type": "str"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "db_server_patching_details": {"key": "dbServerPatchingDetails", "type": "DbServerPatchingDetails"}, - "max_memory_in_gbs": {"key": "maxMemoryInGbs", "type": "int"}, - "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "vm_cluster_ids": {"key": "vmClusterIds", "type": "[str]"}, - "db_node_ids": {"key": "dbNodeIds", "type": "[str]"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "max_cpu_count": {"key": "maxCpuCount", "type": "int"}, - "autonomous_vm_cluster_ids": {"key": "autonomousVmClusterIds", "type": "[str]"}, - "autonomous_virtual_machine_ids": {"key": "autonomousVirtualMachineIds", "type": "[str]"}, - "max_db_node_storage_in_gbs": {"key": "maxDbNodeStorageInGbs", "type": "int"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "shape": {"key": "shape", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.ocid = None - self.display_name = None - self.compartment_id = None - self.exadata_infrastructure_id = None - self.cpu_core_count = None - self.db_server_patching_details = None - self.max_memory_in_gbs = None - self.db_node_storage_size_in_gbs = None - self.vm_cluster_ids = None - self.db_node_ids = None - self.lifecycle_details = None - self.lifecycle_state = None - self.max_cpu_count = None - self.autonomous_vm_cluster_ids = None - self.autonomous_virtual_machine_ids = None - self.max_db_node_storage_in_gbs = None - self.memory_size_in_gbs = None - self.shape = None - self.time_created = None - self.provisioning_state = None - - -class DbSystemShape(ProxyResource): - """DbSystemShape resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DbSystemShapeProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DbSystemShapeProperties"}, - } - - def __init__(self, *, properties: Optional["_models.DbSystemShapeProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DbSystemShapeProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class DbSystemShapeListResult(_serialization.Model): - """The response of a DbSystemShape list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The DbSystemShape items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DbSystemShape] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DbSystemShape]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DbSystemShape"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The DbSystemShape items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DbSystemShape] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DbSystemShapeProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """DbSystemShape resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar shape_family: The family of the shape used for the DB system. - :vartype shape_family: str - :ivar available_core_count: The maximum number of CPU cores that can be enabled on the DB - system for this shape. Required. - :vartype available_core_count: int - :ivar minimum_core_count: The minimum number of CPU cores that can be enabled on the DB system - for this shape. - :vartype minimum_core_count: int - :ivar runtime_minimum_core_count: The runtime minimum number of CPU cores that can be enabled - on the DB system for this shape. - :vartype runtime_minimum_core_count: int - :ivar core_count_increment: The discrete number by which the CPU core count for this shape can - be increased or decreased. - :vartype core_count_increment: int - :ivar min_storage_count: The minimum number of Exadata storage servers available for the - Exadata infrastructure. - :vartype min_storage_count: int - :ivar max_storage_count: The maximum number of Exadata storage servers available for the - Exadata infrastructure. - :vartype max_storage_count: int - :ivar available_data_storage_per_server_in_tbs: The maximum data storage available per storage - server for this shape. Only applicable to ExaCC Elastic shapes. - :vartype available_data_storage_per_server_in_tbs: float - :ivar available_memory_per_node_in_gbs: The maximum memory available per database node for this - shape. Only applicable to ExaCC Elastic shapes. - :vartype available_memory_per_node_in_gbs: int - :ivar available_db_node_per_node_in_gbs: The maximum Db Node storage available per database - node for this shape. Only applicable to ExaCC Elastic shapes. - :vartype available_db_node_per_node_in_gbs: int - :ivar min_core_count_per_node: The minimum number of CPU cores that can be enabled per node for - this shape. - :vartype min_core_count_per_node: int - :ivar available_memory_in_gbs: The maximum memory that can be enabled for this shape. - :vartype available_memory_in_gbs: int - :ivar min_memory_per_node_in_gbs: The minimum memory that need be allocated per node for this - shape. - :vartype min_memory_per_node_in_gbs: int - :ivar available_db_node_storage_in_gbs: The maximum Db Node storage that can be enabled for - this shape. - :vartype available_db_node_storage_in_gbs: int - :ivar min_db_node_storage_per_node_in_gbs: The minimum Db Node storage that need be allocated - per node for this shape. - :vartype min_db_node_storage_per_node_in_gbs: int - :ivar available_data_storage_in_tbs: The maximum DATA storage that can be enabled for this - shape. - :vartype available_data_storage_in_tbs: int - :ivar min_data_storage_in_tbs: The minimum data storage that need be allocated for this shape. - :vartype min_data_storage_in_tbs: int - :ivar minimum_node_count: The minimum number of database nodes available for this shape. - :vartype minimum_node_count: int - :ivar maximum_node_count: The maximum number of database nodes available for this shape. - :vartype maximum_node_count: int - :ivar available_core_count_per_node: The maximum number of CPU cores per database node that can - be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. - :vartype available_core_count_per_node: int - """ - - _validation = { - "shape_family": {"readonly": True, "max_length": 255, "min_length": 1}, - "available_core_count": {"required": True, "readonly": True}, - "minimum_core_count": {"readonly": True}, - "runtime_minimum_core_count": {"readonly": True}, - "core_count_increment": {"readonly": True}, - "min_storage_count": {"readonly": True}, - "max_storage_count": {"readonly": True}, - "available_data_storage_per_server_in_tbs": {"readonly": True}, - "available_memory_per_node_in_gbs": {"readonly": True}, - "available_db_node_per_node_in_gbs": {"readonly": True}, - "min_core_count_per_node": {"readonly": True}, - "available_memory_in_gbs": {"readonly": True}, - "min_memory_per_node_in_gbs": {"readonly": True}, - "available_db_node_storage_in_gbs": {"readonly": True}, - "min_db_node_storage_per_node_in_gbs": {"readonly": True}, - "available_data_storage_in_tbs": {"readonly": True}, - "min_data_storage_in_tbs": {"readonly": True}, - "minimum_node_count": {"readonly": True}, - "maximum_node_count": {"readonly": True}, - "available_core_count_per_node": {"readonly": True}, - } - - _attribute_map = { - "shape_family": {"key": "shapeFamily", "type": "str"}, - "available_core_count": {"key": "availableCoreCount", "type": "int"}, - "minimum_core_count": {"key": "minimumCoreCount", "type": "int"}, - "runtime_minimum_core_count": {"key": "runtimeMinimumCoreCount", "type": "int"}, - "core_count_increment": {"key": "coreCountIncrement", "type": "int"}, - "min_storage_count": {"key": "minStorageCount", "type": "int"}, - "max_storage_count": {"key": "maxStorageCount", "type": "int"}, - "available_data_storage_per_server_in_tbs": {"key": "availableDataStoragePerServerInTbs", "type": "float"}, - "available_memory_per_node_in_gbs": {"key": "availableMemoryPerNodeInGbs", "type": "int"}, - "available_db_node_per_node_in_gbs": {"key": "availableDbNodePerNodeInGbs", "type": "int"}, - "min_core_count_per_node": {"key": "minCoreCountPerNode", "type": "int"}, - "available_memory_in_gbs": {"key": "availableMemoryInGbs", "type": "int"}, - "min_memory_per_node_in_gbs": {"key": "minMemoryPerNodeInGbs", "type": "int"}, - "available_db_node_storage_in_gbs": {"key": "availableDbNodeStorageInGbs", "type": "int"}, - "min_db_node_storage_per_node_in_gbs": {"key": "minDbNodeStoragePerNodeInGbs", "type": "int"}, - "available_data_storage_in_tbs": {"key": "availableDataStorageInTbs", "type": "int"}, - "min_data_storage_in_tbs": {"key": "minDataStorageInTbs", "type": "int"}, - "minimum_node_count": {"key": "minimumNodeCount", "type": "int"}, - "maximum_node_count": {"key": "maximumNodeCount", "type": "int"}, - "available_core_count_per_node": {"key": "availableCoreCountPerNode", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.shape_family = None - self.available_core_count = None - self.minimum_core_count = None - self.runtime_minimum_core_count = None - self.core_count_increment = None - self.min_storage_count = None - self.max_storage_count = None - self.available_data_storage_per_server_in_tbs = None - self.available_memory_per_node_in_gbs = None - self.available_db_node_per_node_in_gbs = None - self.min_core_count_per_node = None - self.available_memory_in_gbs = None - self.min_memory_per_node_in_gbs = None - self.available_db_node_storage_in_gbs = None - self.min_db_node_storage_per_node_in_gbs = None - self.available_data_storage_in_tbs = None - self.min_data_storage_in_tbs = None - self.minimum_node_count = None - self.maximum_node_count = None - self.available_core_count_per_node = None - - -class DnsPrivateView(ProxyResource): - """DnsPrivateView resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateViewProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DnsPrivateViewProperties"}, - } - - def __init__(self, *, properties: Optional["_models.DnsPrivateViewProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateViewProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class DnsPrivateViewListResult(_serialization.Model): - """The response of a DnsPrivateView list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The DnsPrivateView items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateView] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DnsPrivateView]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.DnsPrivateView"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The DnsPrivateView items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateView] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DnsPrivateViewProperties(_serialization.Model): - """Views resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar ocid: The OCID of the view. Required. - :vartype ocid: str - :ivar display_name: The display name of the view resource. - :vartype display_name: str - :ivar is_protected: A Boolean flag indicating whether or not parts of the resource are unable - to be explicitly managed. Required. - :vartype is_protected: bool - :ivar lifecycle_state: Views lifecycleState. Known values are: "Active", "Deleted", "Deleting", - and "Updating". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.DnsPrivateViewsLifecycleState - :ivar self_property: The canonical absolute URL of the resource. Required. - :vartype self_property: str - :ivar time_created: views timeCreated. Required. - :vartype time_created: ~datetime.datetime - :ivar time_updated: views timeCreated. Required. - :vartype time_updated: ~datetime.datetime - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState - """ - - _validation = { - "ocid": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "display_name": {"readonly": True}, - "is_protected": {"required": True, "readonly": True}, - "lifecycle_state": {"readonly": True}, - "self_property": {"required": True, "readonly": True}, - "time_created": {"required": True, "readonly": True}, - "time_updated": {"required": True, "readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "is_protected": {"key": "isProtected", "type": "bool"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "self_property": {"key": "self", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "time_updated": {"key": "timeUpdated", "type": "iso-8601"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.ocid = None - self.display_name = None - self.is_protected = None - self.lifecycle_state = None - self.self_property = None - self.time_created = None - self.time_updated = None - self.provisioning_state = None - - -class DnsPrivateZone(ProxyResource): - """DnsPrivateZone resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateZoneProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DnsPrivateZoneProperties"}, - } - - def __init__(self, *, properties: Optional["_models.DnsPrivateZoneProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateZoneProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class DnsPrivateZoneListResult(_serialization.Model): - """The response of a DnsPrivateZone list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The DnsPrivateZone items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateZone] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DnsPrivateZone]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.DnsPrivateZone"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The DnsPrivateZone items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateZone] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DnsPrivateZoneProperties(_serialization.Model): - """Zones resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar ocid: The OCID of the Zone. Required. - :vartype ocid: str - :ivar is_protected: A Boolean flag indicating whether or not parts of the resource are unable - to be explicitly managed. Required. - :vartype is_protected: bool - :ivar lifecycle_state: Zones lifecycleState. Known values are: "Active", "Creating", "Deleted", - "Deleting", and "Updating". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.DnsPrivateZonesLifecycleState - :ivar self_property: The canonical absolute URL of the resource. Required. - :vartype self_property: str - :ivar serial: The current serial of the zone. As seen in the zone's SOA record. Required. - :vartype serial: int - :ivar version: Version is the never-repeating, totally-orderable, version of the zone, from - which the serial field of the zone's SOA record is derived. Required. - :vartype version: str - :ivar view_id: The OCID of the private view containing the zone. This value will be null for - zones in the global DNS, which are publicly resolvable and not part of a private view. - :vartype view_id: str - :ivar zone_type: The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only - supported for GLOBAL zones. Required. Known values are: "Primary" and "Secondary". - :vartype zone_type: str or ~azure.mgmt.oracledatabase.models.ZoneType - :ivar time_created: Zones timeCreated. Required. - :vartype time_created: ~datetime.datetime - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState - """ - - _validation = { - "ocid": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "is_protected": {"required": True, "readonly": True}, - "lifecycle_state": {"readonly": True}, - "self_property": {"required": True, "readonly": True}, - "serial": {"required": True, "readonly": True}, - "version": {"required": True, "readonly": True}, - "view_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "zone_type": {"required": True, "readonly": True}, - "time_created": {"required": True, "readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "is_protected": {"key": "isProtected", "type": "bool"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "self_property": {"key": "self", "type": "str"}, - "serial": {"key": "serial", "type": "int"}, - "version": {"key": "version", "type": "str"}, - "view_id": {"key": "viewId", "type": "str"}, - "zone_type": {"key": "zoneType", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.ocid = None - self.is_protected = None - self.lifecycle_state = None - self.self_property = None - self.serial = None - self.version = None - self.view_id = None - self.zone_type = None - self.time_created = None - self.provisioning_state = None - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.oracledatabase.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.oracledatabase.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.oracledatabase.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.oracledatabase.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class EstimatedPatchingTime(_serialization.Model): - """The estimated total time required in minutes for all patching operations (database server, - storage server, and network switch patching). - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar estimated_db_server_patching_time: The estimated time required in minutes for database - server patching. - :vartype estimated_db_server_patching_time: int - :ivar estimated_network_switches_patching_time: The estimated time required in minutes for - network switch patching. - :vartype estimated_network_switches_patching_time: int - :ivar estimated_storage_server_patching_time: The estimated time required in minutes for - storage server patching. - :vartype estimated_storage_server_patching_time: int - :ivar total_estimated_patching_time: The estimated total time required in minutes for all - patching operations. - :vartype total_estimated_patching_time: int - """ - - _validation = { - "estimated_db_server_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, - "estimated_network_switches_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, - "estimated_storage_server_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, - "total_estimated_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, - } - - _attribute_map = { - "estimated_db_server_patching_time": {"key": "estimatedDbServerPatchingTime", "type": "int"}, - "estimated_network_switches_patching_time": {"key": "estimatedNetworkSwitchesPatchingTime", "type": "int"}, - "estimated_storage_server_patching_time": {"key": "estimatedStorageServerPatchingTime", "type": "int"}, - "total_estimated_patching_time": {"key": "totalEstimatedPatchingTime", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.estimated_db_server_patching_time = None - self.estimated_network_switches_patching_time = None - self.estimated_storage_server_patching_time = None - self.total_estimated_patching_time = None - - -class ExadataIormConfig(_serialization.Model): - """ExadataIormConfig for cloud vm cluster. - - :ivar db_plans: An array of IORM settings for all the database in the Exadata DB system. - :vartype db_plans: list[~azure.mgmt.oracledatabase.models.DbIormConfig] - :ivar lifecycle_details: Additional information about the current lifecycleState. - :vartype lifecycle_details: str - :ivar lifecycle_state: The current state of IORM configuration for the Exadata DB system. Known - values are: "BootStrapping", "Enabled", "Disabled", "Updating", and "Failed". - :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.IormLifecycleState - :ivar objective: The current value for the IORM objective. The default is AUTO. Known values - are: "LowLatency", "HighThroughput", "Balanced", "Auto", and "Basic". - :vartype objective: str or ~azure.mgmt.oracledatabase.models.Objective - """ - - _attribute_map = { - "db_plans": {"key": "dbPlans", "type": "[DbIormConfig]"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "objective": {"key": "objective", "type": "str"}, - } - - def __init__( - self, - *, - db_plans: Optional[List["_models.DbIormConfig"]] = None, - lifecycle_details: Optional[str] = None, - lifecycle_state: Optional[Union[str, "_models.IormLifecycleState"]] = None, - objective: Optional[Union[str, "_models.Objective"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword db_plans: An array of IORM settings for all the database in the Exadata DB system. - :paramtype db_plans: list[~azure.mgmt.oracledatabase.models.DbIormConfig] - :keyword lifecycle_details: Additional information about the current lifecycleState. - :paramtype lifecycle_details: str - :keyword lifecycle_state: The current state of IORM configuration for the Exadata DB system. - Known values are: "BootStrapping", "Enabled", "Disabled", "Updating", and "Failed". - :paramtype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.IormLifecycleState - :keyword objective: The current value for the IORM objective. The default is AUTO. Known values - are: "LowLatency", "HighThroughput", "Balanced", "Auto", and "Basic". - :paramtype objective: str or ~azure.mgmt.oracledatabase.models.Objective - """ - super().__init__(**kwargs) - self.db_plans = db_plans - self.lifecycle_details = lifecycle_details - self.lifecycle_state = lifecycle_state - self.objective = objective - - -class GenerateAutonomousDatabaseWalletDetails(_serialization.Model): - """Autonomous Database Generate Wallet resource model. - - All required parameters must be populated in order to send to server. - - :ivar generate_type: The type of wallet to generate. Known values are: "Single" and "All". - :vartype generate_type: str or ~azure.mgmt.oracledatabase.models.GenerateType - :ivar is_regional: True when requesting regional connection strings in PDB connect info, - applicable to cross-region DG only. - :vartype is_regional: bool - :ivar password: The password to encrypt the keys inside the wallet. Required. - :vartype password: str - """ - - _validation = { - "password": {"required": True}, - } - - _attribute_map = { - "generate_type": {"key": "generateType", "type": "str"}, - "is_regional": {"key": "isRegional", "type": "bool"}, - "password": {"key": "password", "type": "str"}, - } - - def __init__( - self, - *, - password: str, - generate_type: Optional[Union[str, "_models.GenerateType"]] = None, - is_regional: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword generate_type: The type of wallet to generate. Known values are: "Single" and "All". - :paramtype generate_type: str or ~azure.mgmt.oracledatabase.models.GenerateType - :keyword is_regional: True when requesting regional connection strings in PDB connect info, - applicable to cross-region DG only. - :paramtype is_regional: bool - :keyword password: The password to encrypt the keys inside the wallet. Required. - :paramtype password: str - """ - super().__init__(**kwargs) - self.generate_type = generate_type - self.is_regional = is_regional - self.password = password - - -class GiVersion(ProxyResource): - """GiVersion resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.GiVersionProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "GiVersionProperties"}, - } - - def __init__(self, *, properties: Optional["_models.GiVersionProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.GiVersionProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class GiVersionListResult(_serialization.Model): - """The response of a GiVersion list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The GiVersion items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.GiVersion] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GiVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.GiVersion"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The GiVersion items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.GiVersion] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class GiVersionProperties(_serialization.Model): - """GiVersion resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar version: A valid Oracle Grid Infrastructure (GI) software version. Required. - :vartype version: str - """ - - _validation = { - "version": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.version = None - - -class LongTermBackUpScheduleDetails(_serialization.Model): - """Details for the long-term backup schedule. - - :ivar repeat_cadence: The frequency of the long-term backup schedule. Known values are: - "OneTime", "Weekly", "Monthly", and "Yearly". - :vartype repeat_cadence: str or ~azure.mgmt.oracledatabase.models.RepeatCadenceType - :ivar time_of_backup: The timestamp for the long-term backup schedule. For a MONTHLY cadence, - months having fewer days than the provided date will have the backup taken on the last day of - that month. - :vartype time_of_backup: ~datetime.datetime - :ivar retention_period_in_days: Retention period, in days, for backups. - :vartype retention_period_in_days: int - :ivar is_disabled: Indicates if the long-term backup schedule should be deleted. The default - value is ``FALSE``. - :vartype is_disabled: bool - """ - - _validation = { - "retention_period_in_days": {"maximum": 2558, "minimum": 90}, - } - - _attribute_map = { - "repeat_cadence": {"key": "repeatCadence", "type": "str"}, - "time_of_backup": {"key": "timeOfBackup", "type": "iso-8601"}, - "retention_period_in_days": {"key": "retentionPeriodInDays", "type": "int"}, - "is_disabled": {"key": "isDisabled", "type": "bool"}, - } - - def __init__( - self, - *, - repeat_cadence: Optional[Union[str, "_models.RepeatCadenceType"]] = None, - time_of_backup: Optional[datetime.datetime] = None, - retention_period_in_days: Optional[int] = None, - is_disabled: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword repeat_cadence: The frequency of the long-term backup schedule. Known values are: - "OneTime", "Weekly", "Monthly", and "Yearly". - :paramtype repeat_cadence: str or ~azure.mgmt.oracledatabase.models.RepeatCadenceType - :keyword time_of_backup: The timestamp for the long-term backup schedule. For a MONTHLY - cadence, months having fewer days than the provided date will have the backup taken on the last - day of that month. - :paramtype time_of_backup: ~datetime.datetime - :keyword retention_period_in_days: Retention period, in days, for backups. - :paramtype retention_period_in_days: int - :keyword is_disabled: Indicates if the long-term backup schedule should be deleted. The default - value is ``FALSE``. - :paramtype is_disabled: bool - """ - super().__init__(**kwargs) - self.repeat_cadence = repeat_cadence - self.time_of_backup = time_of_backup - self.retention_period_in_days = retention_period_in_days - self.is_disabled = is_disabled - - -class MaintenanceWindow(_serialization.Model): - """MaintenanceWindow resource properties. - - :ivar preference: The maintenance window scheduling preference. Known values are: - "NoPreference" and "CustomPreference". - :vartype preference: str or ~azure.mgmt.oracledatabase.models.Preference - :ivar months: Months during the year when maintenance should be performed. - :vartype months: list[~azure.mgmt.oracledatabase.models.Month] - :ivar weeks_of_month: Weeks during the month when maintenance should be performed. Weeks start - on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start - and end based on calendar dates, not days of the week. For example, to allow maintenance during - the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. - Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. - Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to - allow you to specify specific days of the week and hours that maintenance will be performed. - :vartype weeks_of_month: list[int] - :ivar days_of_week: Days during the week when maintenance should be performed. - :vartype days_of_week: list[~azure.mgmt.oracledatabase.models.DayOfWeek] - :ivar hours_of_day: The window of hours during the day when maintenance should be performed. - The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - - represents time slot 20:00 - 23:59 UTC. - :vartype hours_of_day: list[int] - :ivar lead_time_in_weeks: Lead time window allows user to set a lead time to prepare for a down - time. The lead time is in weeks and valid value is between 1 to 4. - :vartype lead_time_in_weeks: int - :ivar patching_mode: Cloud Exadata infrastructure node patching method. Known values are: - "Rolling" and "NonRolling". - :vartype patching_mode: str or ~azure.mgmt.oracledatabase.models.PatchingMode - :ivar custom_action_timeout_in_mins: Determines the amount of time the system will wait before - the start of each database server patching operation. Custom action timeout is in minutes and - valid value is between 15 to 120 (inclusive). - :vartype custom_action_timeout_in_mins: int - :ivar is_custom_action_timeout_enabled: If true, enables the configuration of a custom action - timeout (waiting period) between database server patching operations. - :vartype is_custom_action_timeout_enabled: bool - :ivar is_monthly_patching_enabled: is Monthly Patching Enabled. - :vartype is_monthly_patching_enabled: bool - """ - - _validation = { - "custom_action_timeout_in_mins": {"maximum": 120, "minimum": 0}, - } - - _attribute_map = { - "preference": {"key": "preference", "type": "str"}, - "months": {"key": "months", "type": "[Month]"}, - "weeks_of_month": {"key": "weeksOfMonth", "type": "[int]"}, - "days_of_week": {"key": "daysOfWeek", "type": "[DayOfWeek]"}, - "hours_of_day": {"key": "hoursOfDay", "type": "[int]"}, - "lead_time_in_weeks": {"key": "leadTimeInWeeks", "type": "int"}, - "patching_mode": {"key": "patchingMode", "type": "str"}, - "custom_action_timeout_in_mins": {"key": "customActionTimeoutInMins", "type": "int"}, - "is_custom_action_timeout_enabled": {"key": "isCustomActionTimeoutEnabled", "type": "bool"}, - "is_monthly_patching_enabled": {"key": "isMonthlyPatchingEnabled", "type": "bool"}, - } - - def __init__( - self, - *, - preference: Optional[Union[str, "_models.Preference"]] = None, - months: Optional[List["_models.Month"]] = None, - weeks_of_month: Optional[List[int]] = None, - days_of_week: Optional[List["_models.DayOfWeek"]] = None, - hours_of_day: Optional[List[int]] = None, - lead_time_in_weeks: Optional[int] = None, - patching_mode: Optional[Union[str, "_models.PatchingMode"]] = None, - custom_action_timeout_in_mins: Optional[int] = None, - is_custom_action_timeout_enabled: Optional[bool] = None, - is_monthly_patching_enabled: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword preference: The maintenance window scheduling preference. Known values are: - "NoPreference" and "CustomPreference". - :paramtype preference: str or ~azure.mgmt.oracledatabase.models.Preference - :keyword months: Months during the year when maintenance should be performed. - :paramtype months: list[~azure.mgmt.oracledatabase.models.Month] - :keyword weeks_of_month: Weeks during the month when maintenance should be performed. Weeks - start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks - start and end based on calendar dates, not days of the week. For example, to allow maintenance - during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value - 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. - Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to - allow you to specify specific days of the week and hours that maintenance will be performed. - :paramtype weeks_of_month: list[int] - :keyword days_of_week: Days during the week when maintenance should be performed. - :paramtype days_of_week: list[~azure.mgmt.oracledatabase.models.DayOfWeek] - :keyword hours_of_day: The window of hours during the day when maintenance should be performed. - The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - - represents time slot 20:00 - 23:59 UTC. - :paramtype hours_of_day: list[int] - :keyword lead_time_in_weeks: Lead time window allows user to set a lead time to prepare for a - down time. The lead time is in weeks and valid value is between 1 to 4. - :paramtype lead_time_in_weeks: int - :keyword patching_mode: Cloud Exadata infrastructure node patching method. Known values are: - "Rolling" and "NonRolling". - :paramtype patching_mode: str or ~azure.mgmt.oracledatabase.models.PatchingMode - :keyword custom_action_timeout_in_mins: Determines the amount of time the system will wait - before the start of each database server patching operation. Custom action timeout is in - minutes and valid value is between 15 to 120 (inclusive). - :paramtype custom_action_timeout_in_mins: int - :keyword is_custom_action_timeout_enabled: If true, enables the configuration of a custom - action timeout (waiting period) between database server patching operations. - :paramtype is_custom_action_timeout_enabled: bool - :keyword is_monthly_patching_enabled: is Monthly Patching Enabled. - :paramtype is_monthly_patching_enabled: bool - """ - super().__init__(**kwargs) - self.preference = preference - self.months = months - self.weeks_of_month = weeks_of_month - self.days_of_week = days_of_week - self.hours_of_day = hours_of_day - self.lead_time_in_weeks = lead_time_in_weeks - self.patching_mode = patching_mode - self.custom_action_timeout_in_mins = custom_action_timeout_in_mins - self.is_custom_action_timeout_enabled = is_custom_action_timeout_enabled - self.is_monthly_patching_enabled = is_monthly_patching_enabled - - -class Month(_serialization.Model): - """Month resource properties. - - All required parameters must be populated in order to send to server. - - :ivar name: Name of the month of the year. Required. Known values are: "January", "February", - "March", "April", "May", "June", "July", "August", "September", "October", "November", and - "December". - :vartype name: str or ~azure.mgmt.oracledatabase.models.MonthName - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - } - - def __init__(self, *, name: Union[str, "_models.MonthName"], **kwargs: Any) -> None: - """ - :keyword name: Name of the month of the year. Required. Known values are: "January", - "February", "March", "April", "May", "June", "July", "August", "September", "October", - "November", and "December". - :paramtype name: str or ~azure.mgmt.oracledatabase.models.MonthName - """ - super().__init__(**kwargs) - self.name = name - - -class NsgCidr(_serialization.Model): - """A rule for allowing inbound (INGRESS) IP packets. - - All required parameters must be populated in order to send to server. - - :ivar source: Conceptually, this is the range of IP addresses that a packet coming into the - instance can come from. Required. - :vartype source: str - :ivar destination_port_range: Destination port range to specify particular destination ports - for TCP rules. - :vartype destination_port_range: ~azure.mgmt.oracledatabase.models.PortRange - """ - - _validation = { - "source": {"required": True, "max_length": 128, "min_length": 1}, - } - - _attribute_map = { - "source": {"key": "source", "type": "str"}, - "destination_port_range": {"key": "destinationPortRange", "type": "PortRange"}, - } - - def __init__( - self, *, source: str, destination_port_range: Optional["_models.PortRange"] = None, **kwargs: Any - ) -> None: - """ - :keyword source: Conceptually, this is the range of IP addresses that a packet coming into the - instance can come from. Required. - :paramtype source: str - :keyword destination_port_range: Destination port range to specify particular destination ports - for TCP rules. - :paramtype destination_port_range: ~azure.mgmt.oracledatabase.models.PortRange - """ - super().__init__(**kwargs) - self.source = source - self.destination_port_range = destination_port_range - - -class Operation(_serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.oracledatabase.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.oracledatabase.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.oracledatabase.models.ActionType - """ - - _validation = { - "name": {"readonly": True}, - "is_data_action": {"readonly": True}, - "origin": {"readonly": True}, - "action_type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "action_type": {"key": "actionType", "type": "str"}, - } - - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.oracledatabase.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(_serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - "provider": {"readonly": True}, - "resource": {"readonly": True}, - "operation": {"readonly": True}, - "description": {"readonly": True}, - } - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link - to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.oracledatabase.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class OracleSubscription(ProxyResource): - """OracleSubscription resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionProperties - :ivar plan: Details of the resource plan. - :vartype plan: ~azure.mgmt.oracledatabase.models.Plan - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "OracleSubscriptionProperties"}, - "plan": {"key": "plan", "type": "Plan"}, - } - - def __init__( - self, - *, - properties: Optional["_models.OracleSubscriptionProperties"] = None, - plan: Optional["_models.Plan"] = None, - **kwargs: Any - ) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionProperties - :keyword plan: Details of the resource plan. - :paramtype plan: ~azure.mgmt.oracledatabase.models.Plan - """ - super().__init__(**kwargs) - self.properties = properties - self.plan = plan - - -class OracleSubscriptionListResult(_serialization.Model): - """The response of a OracleSubscription list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The OracleSubscription items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.OracleSubscription] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OracleSubscription]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.OracleSubscription"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The OracleSubscription items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.OracleSubscription] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class OracleSubscriptionProperties(_serialization.Model): - """Oracle Subscription resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: OracleSubscriptionProvisioningState provisioning state. Known values - are: "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.OracleSubscriptionProvisioningState - :ivar saas_subscription_id: SAAS subscription ID generated by Marketplace. - :vartype saas_subscription_id: str - :ivar cloud_account_id: Cloud Account Id. - :vartype cloud_account_id: str - :ivar cloud_account_state: Cloud Account provisioning state. Known values are: "Pending", - "Provisioning", and "Available". - :vartype cloud_account_state: str or - ~azure.mgmt.oracledatabase.models.CloudAccountProvisioningState - :ivar term_unit: Term Unit. P1Y, P3Y, etc, see Durations - https://en.wikipedia.org/wiki/ISO_8601. - :vartype term_unit: str - :ivar product_code: Product code for the term unit. - :vartype product_code: str - :ivar intent: Intent for the update operation. Known values are: "Retain" and "Reset". - :vartype intent: str or ~azure.mgmt.oracledatabase.models.Intent - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "saas_subscription_id": {"readonly": True}, - "cloud_account_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "cloud_account_state": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "saas_subscription_id": {"key": "saasSubscriptionId", "type": "str"}, - "cloud_account_id": {"key": "cloudAccountId", "type": "str"}, - "cloud_account_state": {"key": "cloudAccountState", "type": "str"}, - "term_unit": {"key": "termUnit", "type": "str"}, - "product_code": {"key": "productCode", "type": "str"}, - "intent": {"key": "intent", "type": "str"}, - } - - def __init__( - self, - *, - term_unit: Optional[str] = None, - product_code: Optional[str] = None, - intent: Optional[Union[str, "_models.Intent"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword term_unit: Term Unit. P1Y, P3Y, etc, see Durations - https://en.wikipedia.org/wiki/ISO_8601. - :paramtype term_unit: str - :keyword product_code: Product code for the term unit. - :paramtype product_code: str - :keyword intent: Intent for the update operation. Known values are: "Retain" and "Reset". - :paramtype intent: str or ~azure.mgmt.oracledatabase.models.Intent - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.saas_subscription_id = None - self.cloud_account_id = None - self.cloud_account_state = None - self.term_unit = term_unit - self.product_code = product_code - self.intent = intent - - -class OracleSubscriptionUpdate(_serialization.Model): - """The type used for update operations of the OracleSubscription. - - :ivar plan: Details of the resource plan. - :vartype plan: ~azure.mgmt.oracledatabase.models.PlanUpdate - :ivar properties: The updatable properties of the OracleSubscription. - :vartype properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdateProperties - """ - - _attribute_map = { - "plan": {"key": "plan", "type": "PlanUpdate"}, - "properties": {"key": "properties", "type": "OracleSubscriptionUpdateProperties"}, - } - - def __init__( - self, - *, - plan: Optional["_models.PlanUpdate"] = None, - properties: Optional["_models.OracleSubscriptionUpdateProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword plan: Details of the resource plan. - :paramtype plan: ~azure.mgmt.oracledatabase.models.PlanUpdate - :keyword properties: The updatable properties of the OracleSubscription. - :paramtype properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdateProperties - """ - super().__init__(**kwargs) - self.plan = plan - self.properties = properties - - -class OracleSubscriptionUpdateProperties(_serialization.Model): - """The updatable properties of the OracleSubscription. - - :ivar product_code: Product code for the term unit. - :vartype product_code: str - :ivar intent: Intent for the update operation. Known values are: "Retain" and "Reset". - :vartype intent: str or ~azure.mgmt.oracledatabase.models.Intent - """ - - _attribute_map = { - "product_code": {"key": "productCode", "type": "str"}, - "intent": {"key": "intent", "type": "str"}, - } - - def __init__( - self, - *, - product_code: Optional[str] = None, - intent: Optional[Union[str, "_models.Intent"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword product_code: Product code for the term unit. - :paramtype product_code: str - :keyword intent: Intent for the update operation. Known values are: "Retain" and "Reset". - :paramtype intent: str or ~azure.mgmt.oracledatabase.models.Intent - """ - super().__init__(**kwargs) - self.product_code = product_code - self.intent = intent - - -class PeerDbDetails(_serialization.Model): - """PeerDb Details. - - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. - :vartype peer_db_id: str - """ - - _validation = { - "peer_db_id": {"max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "peer_db_id": {"key": "peerDbId", "type": "str"}, - } - - def __init__(self, *, peer_db_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. - :paramtype peer_db_id: str - """ - super().__init__(**kwargs) - self.peer_db_id = peer_db_id - - -class Plan(_serialization.Model): - """Plan for the resource. - - All required parameters must be populated in order to send to server. - - :ivar name: A user defined name of the 3rd Party Artifact that is being procured. Required. - :vartype name: str - :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. - Required. - :vartype publisher: str - :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to - the OfferID specified for the artifact at the time of Data Market onboarding. Required. - :vartype product: str - :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the - said product/artifact. - :vartype promotion_code: str - :ivar version: The version of the desired product/artifact. - :vartype version: str - """ - - _validation = { - "name": {"required": True}, - "publisher": {"required": True}, - "product": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "publisher": {"key": "publisher", "type": "str"}, - "product": {"key": "product", "type": "str"}, - "promotion_code": {"key": "promotionCode", "type": "str"}, - "version": {"key": "version", "type": "str"}, - } - - def __init__( - self, - *, - name: str, - publisher: str, - product: str, - promotion_code: Optional[str] = None, - version: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: A user defined name of the 3rd Party Artifact that is being procured. Required. - :paramtype name: str - :keyword publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. - NewRelic. Required. - :paramtype publisher: str - :keyword product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to - the OfferID specified for the artifact at the time of Data Market onboarding. Required. - :paramtype product: str - :keyword promotion_code: A publisher provided promotion code as provisioned in Data Market for - the said product/artifact. - :paramtype promotion_code: str - :keyword version: The version of the desired product/artifact. - :paramtype version: str - """ - super().__init__(**kwargs) - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code - self.version = version - - -class PlanUpdate(_serialization.Model): - """ResourcePlanTypeUpdate model definition. - - :ivar name: A user defined name of the 3rd Party Artifact that is being procured. - :vartype name: str - :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. - :vartype publisher: str - :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to - the OfferID specified for the artifact at the time of Data Market onboarding. - :vartype product: str - :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the - said product/artifact. - :vartype promotion_code: str - :ivar version: The version of the desired product/artifact. - :vartype version: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "publisher": {"key": "publisher", "type": "str"}, - "product": {"key": "product", "type": "str"}, - "promotion_code": {"key": "promotionCode", "type": "str"}, - "version": {"key": "version", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - publisher: Optional[str] = None, - product: Optional[str] = None, - promotion_code: Optional[str] = None, - version: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: A user defined name of the 3rd Party Artifact that is being procured. - :paramtype name: str - :keyword publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. - NewRelic. - :paramtype publisher: str - :keyword product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to - the OfferID specified for the artifact at the time of Data Market onboarding. - :paramtype product: str - :keyword promotion_code: A publisher provided promotion code as provisioned in Data Market for - the said product/artifact. - :paramtype promotion_code: str - :keyword version: The version of the desired product/artifact. - :paramtype version: str - """ - super().__init__(**kwargs) - self.name = name - self.publisher = publisher - self.product = product - self.promotion_code = promotion_code - self.version = version - - -class PortRange(_serialization.Model): - """Port Range to specify particular destination ports for TCP rules. - - All required parameters must be populated in order to send to server. - - :ivar min: The minimum port number, which must not be greater than the maximum port number. - Required. - :vartype min: int - :ivar max: The maximum port number, which must not be less than the minimum port number. To - specify a single port number, set both the min and max to the same value. Required. - :vartype max: int - """ - - _validation = { - "min": {"required": True, "maximum": 65535, "minimum": 1}, - "max": {"required": True, "maximum": 65535, "minimum": 1}, - } - - _attribute_map = { - "min": {"key": "min", "type": "int"}, - "max": {"key": "max", "type": "int"}, - } - - def __init__( - self, - *, - min: int, # pylint: disable=redefined-builtin - max: int, # pylint: disable=redefined-builtin - **kwargs: Any - ) -> None: - """ - :keyword min: The minimum port number, which must not be greater than the maximum port number. - Required. - :paramtype min: int - :keyword max: The maximum port number, which must not be less than the minimum port number. To - specify a single port number, set both the min and max to the same value. Required. - :paramtype max: int - """ - super().__init__(**kwargs) - self.min = min - self.max = max - - -class PrivateIpAddressesFilter(_serialization.Model): - """Private Ip Addresses filter. - - All required parameters must be populated in order to send to server. - - :ivar subnet_id: Subnet OCID. Required. - :vartype subnet_id: str - :ivar vnic_id: VCN OCID. Required. - :vartype vnic_id: str - """ - - _validation = { - "subnet_id": {"required": True, "max_length": 255, "min_length": 1}, - "vnic_id": {"required": True, "max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "subnet_id": {"key": "subnetId", "type": "str"}, - "vnic_id": {"key": "vnicId", "type": "str"}, - } - - def __init__(self, *, subnet_id: str, vnic_id: str, **kwargs: Any) -> None: - """ - :keyword subnet_id: Subnet OCID. Required. - :paramtype subnet_id: str - :keyword vnic_id: VCN OCID. Required. - :paramtype vnic_id: str - """ - super().__init__(**kwargs) - self.subnet_id = subnet_id - self.vnic_id = vnic_id - - -class PrivateIpAddressProperties(_serialization.Model): - """PrivateIpAddress resource properties. - - All required parameters must be populated in order to send to server. - - :ivar display_name: PrivateIpAddresses displayName. Required. - :vartype display_name: str - :ivar hostname_label: PrivateIpAddresses hostnameLabel. Required. - :vartype hostname_label: str - :ivar ocid: PrivateIpAddresses Id. Required. - :vartype ocid: str - :ivar ip_address: PrivateIpAddresses ipAddress. Required. - :vartype ip_address: str - :ivar subnet_id: PrivateIpAddresses subnetId. Required. - :vartype subnet_id: str - """ - - _validation = { - "display_name": {"required": True}, - "hostname_label": {"required": True}, - "ocid": {"required": True, "max_length": 255, "min_length": 1}, - "ip_address": {"required": True}, - "subnet_id": {"required": True, "max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "display_name": {"key": "displayName", "type": "str"}, - "hostname_label": {"key": "hostnameLabel", "type": "str"}, - "ocid": {"key": "ocid", "type": "str"}, - "ip_address": {"key": "ipAddress", "type": "str"}, - "subnet_id": {"key": "subnetId", "type": "str"}, - } - - def __init__( - self, *, display_name: str, hostname_label: str, ocid: str, ip_address: str, subnet_id: str, **kwargs: Any - ) -> None: - """ - :keyword display_name: PrivateIpAddresses displayName. Required. - :paramtype display_name: str - :keyword hostname_label: PrivateIpAddresses hostnameLabel. Required. - :paramtype hostname_label: str - :keyword ocid: PrivateIpAddresses Id. Required. - :paramtype ocid: str - :keyword ip_address: PrivateIpAddresses ipAddress. Required. - :paramtype ip_address: str - :keyword subnet_id: PrivateIpAddresses subnetId. Required. - :paramtype subnet_id: str - """ - super().__init__(**kwargs) - self.display_name = display_name - self.hostname_label = hostname_label - self.ocid = ocid - self.ip_address = ip_address - self.subnet_id = subnet_id - - -class ProfileType(_serialization.Model): - """The connection string profile to allow clients to group, filter and select connection string - values based on structured metadata. - - All required parameters must be populated in order to send to server. - - :ivar consumer_group: Consumer group used by the connection. Known values are: "High", - "Medium", "Low", "Tp", and "Tpurgent". - :vartype consumer_group: str or ~azure.mgmt.oracledatabase.models.ConsumerGroup - :ivar display_name: A user-friendly name for the connection. Required. - :vartype display_name: str - :ivar host_format: Host format used in connection string. Required. Known values are: "Fqdn" - and "Ip". - :vartype host_format: str or ~azure.mgmt.oracledatabase.models.HostFormatType - :ivar is_regional: True for a regional connection string, applicable to cross-region DG only. - :vartype is_regional: bool - :ivar protocol: Protocol used by the connection. Required. Known values are: "TCP" and "TCPS". - :vartype protocol: str or ~azure.mgmt.oracledatabase.models.ProtocolType - :ivar session_mode: Specifies whether the listener performs a direct hand-off of the session, - or redirects the session. Required. Known values are: "Direct" and "Redirect". - :vartype session_mode: str or ~azure.mgmt.oracledatabase.models.SessionModeType - :ivar syntax_format: Specifies whether the connection string is using the long (LONG), Easy - Connect (EZCONNECT), or Easy Connect Plus (EZCONNECTPLUS) format. Required. Known values are: - "Long", "Ezconnect", and "Ezconnectplus". - :vartype syntax_format: str or ~azure.mgmt.oracledatabase.models.SyntaxFormatType - :ivar tls_authentication: Specifies whether the TLS handshake is using one-way (SERVER) or - mutual (MUTUAL) authentication. Known values are: "Server" and "Mutual". - :vartype tls_authentication: str or ~azure.mgmt.oracledatabase.models.TlsAuthenticationType - :ivar value: Connection string value. Required. - :vartype value: str - """ - - _validation = { - "display_name": {"required": True, "max_length": 255, "min_length": 1}, - "host_format": {"required": True}, - "protocol": {"required": True}, - "session_mode": {"required": True}, - "syntax_format": {"required": True}, - "value": {"required": True}, - } - - _attribute_map = { - "consumer_group": {"key": "consumerGroup", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "host_format": {"key": "hostFormat", "type": "str"}, - "is_regional": {"key": "isRegional", "type": "bool"}, - "protocol": {"key": "protocol", "type": "str"}, - "session_mode": {"key": "sessionMode", "type": "str"}, - "syntax_format": {"key": "syntaxFormat", "type": "str"}, - "tls_authentication": {"key": "tlsAuthentication", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__( - self, - *, - display_name: str, - host_format: Union[str, "_models.HostFormatType"], - protocol: Union[str, "_models.ProtocolType"], - session_mode: Union[str, "_models.SessionModeType"], - syntax_format: Union[str, "_models.SyntaxFormatType"], - value: str, - consumer_group: Optional[Union[str, "_models.ConsumerGroup"]] = None, - is_regional: Optional[bool] = None, - tls_authentication: Optional[Union[str, "_models.TlsAuthenticationType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword consumer_group: Consumer group used by the connection. Known values are: "High", - "Medium", "Low", "Tp", and "Tpurgent". - :paramtype consumer_group: str or ~azure.mgmt.oracledatabase.models.ConsumerGroup - :keyword display_name: A user-friendly name for the connection. Required. - :paramtype display_name: str - :keyword host_format: Host format used in connection string. Required. Known values are: "Fqdn" - and "Ip". - :paramtype host_format: str or ~azure.mgmt.oracledatabase.models.HostFormatType - :keyword is_regional: True for a regional connection string, applicable to cross-region DG - only. - :paramtype is_regional: bool - :keyword protocol: Protocol used by the connection. Required. Known values are: "TCP" and - "TCPS". - :paramtype protocol: str or ~azure.mgmt.oracledatabase.models.ProtocolType - :keyword session_mode: Specifies whether the listener performs a direct hand-off of the - session, or redirects the session. Required. Known values are: "Direct" and "Redirect". - :paramtype session_mode: str or ~azure.mgmt.oracledatabase.models.SessionModeType - :keyword syntax_format: Specifies whether the connection string is using the long (LONG), Easy - Connect (EZCONNECT), or Easy Connect Plus (EZCONNECTPLUS) format. Required. Known values are: - "Long", "Ezconnect", and "Ezconnectplus". - :paramtype syntax_format: str or ~azure.mgmt.oracledatabase.models.SyntaxFormatType - :keyword tls_authentication: Specifies whether the TLS handshake is using one-way (SERVER) or - mutual (MUTUAL) authentication. Known values are: "Server" and "Mutual". - :paramtype tls_authentication: str or ~azure.mgmt.oracledatabase.models.TlsAuthenticationType - :keyword value: Connection string value. Required. - :paramtype value: str - """ - super().__init__(**kwargs) - self.consumer_group = consumer_group - self.display_name = display_name - self.host_format = host_format - self.is_regional = is_regional - self.protocol = protocol - self.session_mode = session_mode - self.syntax_format = syntax_format - self.tls_authentication = tls_authentication - self.value = value - - -class RestoreAutonomousDatabaseDetails(_serialization.Model): - """Details to restore an Oracle Autonomous Database. - - All required parameters must be populated in order to send to server. - - :ivar timestamp: The time to restore the database to. Required. - :vartype timestamp: ~datetime.datetime - """ - - _validation = { - "timestamp": {"required": True}, - } - - _attribute_map = { - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - } - - def __init__(self, *, timestamp: datetime.datetime, **kwargs: Any) -> None: - """ - :keyword timestamp: The time to restore the database to. Required. - :paramtype timestamp: ~datetime.datetime - """ - super().__init__(**kwargs) - self.timestamp = timestamp - - -class SaasSubscriptionDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes - """SaaS Subscription Details model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Purchased SaaS subscription ID. - :vartype id: str - :ivar subscription_name: SaaS subscription name. - :vartype subscription_name: str - :ivar time_created: Creation Date and Time. - :vartype time_created: ~datetime.datetime - :ivar offer_id: Purchased offer ID. - :vartype offer_id: str - :ivar plan_id: Purchased offer's plan ID. - :vartype plan_id: str - :ivar saas_subscription_status: Indicates the status of the Subscription. - :vartype saas_subscription_status: str - :ivar publisher_id: Publisher ID. - :vartype publisher_id: str - :ivar purchaser_email_id: Purchaser Email ID. - :vartype purchaser_email_id: str - :ivar purchaser_tenant_id: Purchaser Tenant ID. - :vartype purchaser_tenant_id: str - :ivar term_unit: Purchase Term Unit. - :vartype term_unit: str - :ivar is_auto_renew: AutoRenew flag. - :vartype is_auto_renew: bool - :ivar is_free_trial: FreeTrial flag. - :vartype is_free_trial: bool - """ - - _validation = { - "id": {"readonly": True}, - "subscription_name": {"readonly": True}, - "time_created": {"readonly": True}, - "offer_id": {"readonly": True}, - "plan_id": {"readonly": True}, - "saas_subscription_status": {"readonly": True}, - "publisher_id": {"readonly": True}, - "purchaser_email_id": {"readonly": True}, - "purchaser_tenant_id": {"readonly": True}, - "term_unit": {"readonly": True}, - "is_auto_renew": {"readonly": True}, - "is_free_trial": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "subscription_name": {"key": "subscriptionName", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "offer_id": {"key": "offerId", "type": "str"}, - "plan_id": {"key": "planId", "type": "str"}, - "saas_subscription_status": {"key": "saasSubscriptionStatus", "type": "str"}, - "publisher_id": {"key": "publisherId", "type": "str"}, - "purchaser_email_id": {"key": "purchaserEmailId", "type": "str"}, - "purchaser_tenant_id": {"key": "purchaserTenantId", "type": "str"}, - "term_unit": {"key": "termUnit", "type": "str"}, - "is_auto_renew": {"key": "isAutoRenew", "type": "bool"}, - "is_free_trial": {"key": "isFreeTrial", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.subscription_name = None - self.time_created = None - self.offer_id = None - self.plan_id = None - self.saas_subscription_status = None - self.publisher_id = None - self.purchaser_email_id = None - self.purchaser_tenant_id = None - self.term_unit = None - self.is_auto_renew = None - self.is_free_trial = None - - -class ScheduledOperationsType(_serialization.Model): - """The list of scheduled operations. - - All required parameters must be populated in order to send to server. - - :ivar day_of_week: Day of week. Required. - :vartype day_of_week: ~azure.mgmt.oracledatabase.models.DayOfWeek - :ivar scheduled_start_time: auto start time. value must be of ISO-8601 format HH:mm. - :vartype scheduled_start_time: str - :ivar scheduled_stop_time: auto stop time. value must be of ISO-8601 format HH:mm. - :vartype scheduled_stop_time: str - """ - - _validation = { - "day_of_week": {"required": True}, - "scheduled_start_time": {"max_length": 50, "min_length": 1}, - "scheduled_stop_time": {"max_length": 50, "min_length": 1}, - } - - _attribute_map = { - "day_of_week": {"key": "dayOfWeek", "type": "DayOfWeek"}, - "scheduled_start_time": {"key": "scheduledStartTime", "type": "str"}, - "scheduled_stop_time": {"key": "scheduledStopTime", "type": "str"}, - } - - def __init__( - self, - *, - day_of_week: "_models.DayOfWeek", - scheduled_start_time: Optional[str] = None, - scheduled_stop_time: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword day_of_week: Day of week. Required. - :paramtype day_of_week: ~azure.mgmt.oracledatabase.models.DayOfWeek - :keyword scheduled_start_time: auto start time. value must be of ISO-8601 format HH:mm. - :paramtype scheduled_start_time: str - :keyword scheduled_stop_time: auto stop time. value must be of ISO-8601 format HH:mm. - :paramtype scheduled_stop_time: str - """ - super().__init__(**kwargs) - self.day_of_week = day_of_week - self.scheduled_start_time = scheduled_start_time - self.scheduled_stop_time = scheduled_stop_time - - -class ScheduledOperationsTypeUpdate(_serialization.Model): - """The list of scheduled operations. - - :ivar day_of_week: Day of week. - :vartype day_of_week: ~azure.mgmt.oracledatabase.models.DayOfWeekUpdate - :ivar scheduled_start_time: auto start time. value must be of ISO-8601 format HH:mm. - :vartype scheduled_start_time: str - :ivar scheduled_stop_time: auto stop time. value must be of ISO-8601 format HH:mm. - :vartype scheduled_stop_time: str - """ - - _validation = { - "scheduled_start_time": {"max_length": 50, "min_length": 1}, - "scheduled_stop_time": {"max_length": 50, "min_length": 1}, - } - - _attribute_map = { - "day_of_week": {"key": "dayOfWeek", "type": "DayOfWeekUpdate"}, - "scheduled_start_time": {"key": "scheduledStartTime", "type": "str"}, - "scheduled_stop_time": {"key": "scheduledStopTime", "type": "str"}, - } - - def __init__( - self, - *, - day_of_week: Optional["_models.DayOfWeekUpdate"] = None, - scheduled_start_time: Optional[str] = None, - scheduled_stop_time: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword day_of_week: Day of week. - :paramtype day_of_week: ~azure.mgmt.oracledatabase.models.DayOfWeekUpdate - :keyword scheduled_start_time: auto start time. value must be of ISO-8601 format HH:mm. - :paramtype scheduled_start_time: str - :keyword scheduled_stop_time: auto stop time. value must be of ISO-8601 format HH:mm. - :paramtype scheduled_stop_time: str - """ - super().__init__(**kwargs) - self.day_of_week = day_of_week - self.scheduled_start_time = scheduled_start_time - self.scheduled_stop_time = scheduled_stop_time - - -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.oracledatabase.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.oracledatabase.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.oracledatabase.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.oracledatabase.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class SystemVersion(ProxyResource): - """SystemVersion resource Definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.SystemVersionProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "SystemVersionProperties"}, - } - - def __init__(self, *, properties: Optional["_models.SystemVersionProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.SystemVersionProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class SystemVersionListResult(_serialization.Model): - """The response of a SystemVersion list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The SystemVersion items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.SystemVersion] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SystemVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.SystemVersion"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The SystemVersion items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.SystemVersion] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SystemVersionProperties(_serialization.Model): - """System Version Resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar system_version: A valid Oracle System Version. Required. - :vartype system_version: str - """ - - _validation = { - "system_version": {"required": True, "readonly": True}, - } - - _attribute_map = { - "system_version": {"key": "systemVersion", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.system_version = None - - -class SystemVersionsFilter(_serialization.Model): - """SystemVersions filter. - - All required parameters must be populated in order to send to server. - - :ivar gi_version: Grid Infrastructure version. Required. - :vartype gi_version: str - :ivar shape: Exadata shape. Required. - :vartype shape: str - :ivar is_latest_version: Check If we have to list only latest versions. - :vartype is_latest_version: bool - """ - - _validation = { - "gi_version": {"required": True}, - "shape": {"required": True}, - } - - _attribute_map = { - "gi_version": {"key": "giVersion", "type": "str"}, - "shape": {"key": "shape", "type": "str"}, - "is_latest_version": {"key": "isLatestVersion", "type": "bool"}, - } - - def __init__(self, *, gi_version: str, shape: str, is_latest_version: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword gi_version: Grid Infrastructure version. Required. - :paramtype gi_version: str - :keyword shape: Exadata shape. Required. - :paramtype shape: str - :keyword is_latest_version: Check If we have to list only latest versions. - :paramtype is_latest_version: bool - """ - super().__init__(**kwargs) - self.gi_version = gi_version - self.shape = shape - self.is_latest_version = is_latest_version - - -class ValidationError(_serialization.Model): - """validation error. - - All required parameters must be populated in order to send to server. - - :ivar code: error code. Required. - :vartype code: str - :ivar message: error message. Required. - :vartype message: str - """ - - _validation = { - "code": {"required": True}, - "message": {"required": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, *, code: str, message: str, **kwargs: Any) -> None: - """ - :keyword code: error code. Required. - :paramtype code: str - :keyword message: error message. Required. - :paramtype message: str - """ - super().__init__(**kwargs) - self.code = code - self.message = message - - -class ValidationResult(_serialization.Model): - """validation result. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar status: validation status. Required. Known values are: "Succeeded" and "Failed". - :vartype status: str or ~azure.mgmt.oracledatabase.models.ValidationStatus - :ivar error: validation error. Required. - :vartype error: ~azure.mgmt.oracledatabase.models.ValidationError - """ - - _validation = { - "status": {"required": True, "readonly": True}, - "error": {"required": True}, - } - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "error": {"key": "error", "type": "ValidationError"}, - } - - def __init__(self, *, error: "_models.ValidationError", **kwargs: Any) -> None: - """ - :keyword error: validation error. Required. - :paramtype error: ~azure.mgmt.oracledatabase.models.ValidationError - """ - super().__init__(**kwargs) - self.status = None - self.error = error - - -class VirtualNetworkAddress(ProxyResource): - """Virtual IP resource belonging to a vm cluster 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. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddressProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "VirtualNetworkAddressProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.VirtualNetworkAddressProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddressProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class VirtualNetworkAddressListResult(_serialization.Model): - """The response of a VirtualNetworkAddress list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The VirtualNetworkAddress items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[VirtualNetworkAddress]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.VirtualNetworkAddress"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The VirtualNetworkAddress items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class VirtualNetworkAddressProperties(_serialization.Model): - """virtualNetworkAddress resource properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ip_address: Virtual network Address address. - :vartype ip_address: str - :ivar vm_ocid: Virtual Machine OCID. - :vartype vm_ocid: str - :ivar ocid: Application VIP OCID. - :vartype ocid: str - :ivar domain: Virtual network address fully qualified domain name. - :vartype domain: str - :ivar lifecycle_details: Additional information about the current lifecycle state of the - application virtual IP (VIP) address. - :vartype lifecycle_details: str - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", "Canceled", and "Provisioning". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState - :ivar lifecycle_state: virtual network address lifecycle state. Known values are: - "Provisioning", "Available", "Terminating", "Terminated", and "Failed". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.VirtualNetworkAddressLifecycleState - :ivar time_assigned: The date and time when the create operation for the application virtual IP - (VIP) address completed. - :vartype time_assigned: ~datetime.datetime - """ - - _validation = { - "vm_ocid": {"max_length": 255, "min_length": 1}, - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "domain": {"readonly": True}, - "lifecycle_details": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "time_assigned": {"readonly": True}, - } - - _attribute_map = { - "ip_address": {"key": "ipAddress", "type": "str"}, - "vm_ocid": {"key": "vmOcid", "type": "str"}, - "ocid": {"key": "ocid", "type": "str"}, - "domain": {"key": "domain", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "time_assigned": {"key": "timeAssigned", "type": "iso-8601"}, - } - - def __init__(self, *, ip_address: Optional[str] = None, vm_ocid: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword ip_address: Virtual network Address address. - :paramtype ip_address: str - :keyword vm_ocid: Virtual Machine OCID. - :paramtype vm_ocid: str - """ - super().__init__(**kwargs) - self.ip_address = ip_address - self.vm_ocid = vm_ocid - self.ocid = None - self.domain = None - self.lifecycle_details = None - self.provisioning_state = None - self.lifecycle_state = None - self.time_assigned = None diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_patch.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_patch.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/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/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/__init__.py index 6cd78dc91ca1..f84dee0a8172 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/__init__.py @@ -2,50 +2,68 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._autonomous_databases_operations import AutonomousDatabasesOperations -from ._cloud_exadata_infrastructures_operations import CloudExadataInfrastructuresOperations -from ._cloud_vm_clusters_operations import CloudVmClustersOperations -from ._autonomous_database_character_sets_operations import AutonomousDatabaseCharacterSetsOperations -from ._autonomous_database_national_character_sets_operations import AutonomousDatabaseNationalCharacterSetsOperations -from ._autonomous_database_versions_operations import AutonomousDatabaseVersionsOperations -from ._db_system_shapes_operations import DbSystemShapesOperations -from ._dns_private_views_operations import DnsPrivateViewsOperations -from ._dns_private_zones_operations import DnsPrivateZonesOperations -from ._gi_versions_operations import GiVersionsOperations -from ._system_versions_operations import SystemVersionsOperations -from ._oracle_subscriptions_operations import OracleSubscriptionsOperations -from ._autonomous_database_backups_operations import AutonomousDatabaseBackupsOperations -from ._db_servers_operations import DbServersOperations -from ._db_nodes_operations import DbNodesOperations -from ._virtual_network_addresses_operations import VirtualNetworkAddressesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import CloudExadataInfrastructuresOperations # type: ignore +from ._operations import ListActionsOperations # type: ignore +from ._operations import DbServersOperations # type: ignore +from ._operations import CloudVmClustersOperations # type: ignore +from ._operations import VirtualNetworkAddressesOperations # type: ignore +from ._operations import SystemVersionsOperations # type: ignore +from ._operations import OracleSubscriptionsOperations # type: ignore +from ._operations import DbNodesOperations # type: ignore +from ._operations import GiVersionsOperations # type: ignore +from ._operations import GiMinorVersionsOperations # type: ignore +from ._operations import DbSystemShapesOperations # type: ignore +from ._operations import DnsPrivateViewsOperations # type: ignore +from ._operations import DnsPrivateZonesOperations # type: ignore +from ._operations import FlexComponentsOperations # type: ignore +from ._operations import AutonomousDatabasesOperations # type: ignore +from ._operations import AutonomousDatabaseBackupsOperations # type: ignore +from ._operations import AutonomousDatabaseCharacterSetsOperations # type: ignore +from ._operations import AutonomousDatabaseNationalCharacterSetsOperations # type: ignore +from ._operations import AutonomousDatabaseVersionsOperations # type: ignore +from ._operations import ExadbVmClustersOperations # type: ignore +from ._operations import ExascaleDbNodesOperations # type: ignore +from ._operations import ExascaleDbStorageVaultsOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "Operations", - "AutonomousDatabasesOperations", "CloudExadataInfrastructuresOperations", + "ListActionsOperations", + "DbServersOperations", "CloudVmClustersOperations", - "AutonomousDatabaseCharacterSetsOperations", - "AutonomousDatabaseNationalCharacterSetsOperations", - "AutonomousDatabaseVersionsOperations", + "VirtualNetworkAddressesOperations", + "SystemVersionsOperations", + "OracleSubscriptionsOperations", + "DbNodesOperations", + "GiVersionsOperations", + "GiMinorVersionsOperations", "DbSystemShapesOperations", "DnsPrivateViewsOperations", "DnsPrivateZonesOperations", - "GiVersionsOperations", - "SystemVersionsOperations", - "OracleSubscriptionsOperations", + "FlexComponentsOperations", + "AutonomousDatabasesOperations", "AutonomousDatabaseBackupsOperations", - "DbServersOperations", - "DbNodesOperations", - "VirtualNetworkAddressesOperations", + "AutonomousDatabaseCharacterSetsOperations", + "AutonomousDatabaseNationalCharacterSetsOperations", + "AutonomousDatabaseVersionsOperations", + "ExadbVmClustersOperations", + "ExascaleDbNodesOperations", + "ExascaleDbStorageVaultsOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_backups_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_backups_operations.py deleted file mode 100644 index 49bc636fbc9e..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_backups_operations.py +++ /dev/null @@ -1,931 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_autonomous_database_request( # pylint: disable=name-too-long - resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, autonomousdatabasename: str, adbbackupid: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - "adbbackupid": _SERIALIZER.url("adbbackupid", adbbackupid, "str", pattern=r".*"), - } - - _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, autonomousdatabasename: str, adbbackupid: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - "adbbackupid": _SERIALIZER.url("adbbackupid", adbbackupid, "str", pattern=r".*"), - } - - _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_update_request( - resource_group_name: str, autonomousdatabasename: str, adbbackupid: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - "adbbackupid": _SERIALIZER.url("adbbackupid", adbbackupid, "str", pattern=r".*"), - } - - _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_delete_request( - resource_group_name: str, autonomousdatabasename: str, adbbackupid: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - "adbbackupid": _SERIALIZER.url("adbbackupid", adbbackupid, "str", pattern=r".*"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class AutonomousDatabaseBackupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`autonomous_database_backups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_autonomous_database( - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> Iterable["_models.AutonomousDatabaseBackup"]: - """List AutonomousDatabaseBackup resources by AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :return: An iterator like instance of either AutonomousDatabaseBackup or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_autonomous_database_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseBackupListResult", 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( - self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any - ) -> _models.AutonomousDatabaseBackup: - """Get a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :return: AutonomousDatabaseBackup or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabaseBackup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - resource: Union[_models.AutonomousDatabaseBackup, IO[bytes]], - **kwargs: Any - ) -> _models.AutonomousDatabaseBackup: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "AutonomousDatabaseBackup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - resource: _models.AutonomousDatabaseBackup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabaseBackup]: - """Create a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup - :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 AutonomousDatabaseBackup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabaseBackup]: - """Create a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either AutonomousDatabaseBackup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - resource: Union[_models.AutonomousDatabaseBackup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabaseBackup]: - """Create a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param resource: Resource create parameters. Is either a AutonomousDatabaseBackup type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup or IO[bytes] - :return: An instance of LROPoller that returns either AutonomousDatabaseBackup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabaseBackup] = 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, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AutonomousDatabaseBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AutonomousDatabaseBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - properties: Union[_models.AutonomousDatabaseBackupUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabaseBackup]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabaseBackup]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "AutonomousDatabaseBackupUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - properties: _models.AutonomousDatabaseBackupUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabaseBackup]: - """Update a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdate - :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 AutonomousDatabaseBackup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabaseBackup]: - """Update a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 AutonomousDatabaseBackup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - adbbackupid: str, - properties: Union[_models.AutonomousDatabaseBackupUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabaseBackup]: - """Update a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: str - :param properties: The resource properties to be updated. Is either a - AutonomousDatabaseBackupUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdate or IO[bytes] - :return: An instance of LROPoller that returns either AutonomousDatabaseBackup or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AutonomousDatabaseBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AutonomousDatabaseBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a AutonomousDatabaseBackup. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param adbbackupid: AutonomousDatabaseBackup id. Required. - :type adbbackupid: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - adbbackupid=adbbackupid, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_character_sets_operations.py deleted file mode 100644 index 8921da8053bc..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_character_sets_operations.py +++ /dev/null @@ -1,256 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location: str, adbscharsetname: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "adbscharsetname": _SERIALIZER.url("adbscharsetname", adbscharsetname, "str", pattern=r".*"), - } - - _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 AutonomousDatabaseCharacterSetsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`autonomous_database_character_sets` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.AutonomousDatabaseCharacterSet"]: - """List AutonomousDatabaseCharacterSet resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either AutonomousDatabaseCharacterSet or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseCharacterSetListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseCharacterSetListResult", 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(self, location: str, adbscharsetname: str, **kwargs: Any) -> _models.AutonomousDatabaseCharacterSet: - """Get a AutonomousDatabaseCharacterSet. - - :param location: The name of the Azure region. Required. - :type location: str - :param adbscharsetname: AutonomousDatabaseCharacterSet name. Required. - :type adbscharsetname: str - :return: AutonomousDatabaseCharacterSet or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseCharacterSet] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - adbscharsetname=adbscharsetname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabaseCharacterSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_national_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_national_character_sets_operations.py deleted file mode 100644 index d871d703a56a..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_national_character_sets_operations.py +++ /dev/null @@ -1,260 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location: str, adbsncharsetname: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "adbsncharsetname": _SERIALIZER.url("adbsncharsetname", adbsncharsetname, "str", pattern=r".*"), - } - - _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 AutonomousDatabaseNationalCharacterSetsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`autonomous_database_national_character_sets` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, location: str, **kwargs: Any - ) -> Iterable["_models.AutonomousDatabaseNationalCharacterSet"]: - """List AutonomousDatabaseNationalCharacterSet resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either AutonomousDatabaseNationalCharacterSet or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseNationalCharacterSetListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseNationalCharacterSetListResult", 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( - self, location: str, adbsncharsetname: str, **kwargs: Any - ) -> _models.AutonomousDatabaseNationalCharacterSet: - """Get a AutonomousDatabaseNationalCharacterSet. - - :param location: The name of the Azure region. Required. - :type location: str - :param adbsncharsetname: AutonomousDatabaseNationalCharacterSets name. Required. - :type adbsncharsetname: str - :return: AutonomousDatabaseNationalCharacterSet or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseNationalCharacterSet] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - adbsncharsetname=adbsncharsetname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabaseNationalCharacterSet", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_versions_operations.py deleted file mode 100644 index 414d425ad5e3..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_versions_operations.py +++ /dev/null @@ -1,256 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location: str, autonomousdbversionsname: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "autonomousdbversionsname": _SERIALIZER.url( - "autonomousdbversionsname", autonomousdbversionsname, "str", pattern=r".*" - ), - } - - _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 AutonomousDatabaseVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`autonomous_database_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.AutonomousDbVersion"]: - """List AutonomousDbVersion resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either AutonomousDbVersion or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDbVersionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDbVersionListResult", 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(self, location: str, autonomousdbversionsname: str, **kwargs: Any) -> _models.AutonomousDbVersion: - """Get a AutonomousDbVersion. - - :param location: The name of the Azure region. Required. - :type location: str - :param autonomousdbversionsname: AutonomousDbVersion name. Required. - :type autonomousdbversionsname: str - :return: AutonomousDbVersion or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDbVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDbVersion] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - autonomousdbversionsname=autonomousdbversionsname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDbVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_databases_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_databases_operations.py deleted file mode 100644 index 577e79ccd86a..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_databases_operations.py +++ /dev/null @@ -1,2002 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/autonomousDatabases") - 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _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, autonomousdatabasename: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _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_update_request( - resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _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_delete_request( - resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _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_failover_request( - resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/failover", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _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_generate_wallet_request( - resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/generateWallet", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _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_restore_request( - resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/restore", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _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_shrink_request( - resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/shrink", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _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_switchover_request( - resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/switchover", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "autonomousdatabasename": _SERIALIZER.url( - "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" - ), - } - - _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 AutonomousDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`autonomous_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.AutonomousDatabase"]: - """List AutonomousDatabase resources by subscription ID. - - :return: An iterator like instance of either AutonomousDatabase or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseListResult", 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.AutonomousDatabase"]: - """List AutonomousDatabase resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either AutonomousDatabase or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_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 = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AutonomousDatabaseListResult", 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(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any) -> _models.AutonomousDatabase: - """Get a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :return: AutonomousDatabase or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabase", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - resource: Union[_models.AutonomousDatabase, IO[bytes]], - **kwargs: Any - ) -> _models.AutonomousDatabase: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "AutonomousDatabase") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - resource: _models.AutonomousDatabase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Create a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabase - :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 AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Create a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - resource: Union[_models.AutonomousDatabase, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Create a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param resource: Resource create parameters. Is either a AutonomousDatabase type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabase or IO[bytes] - :return: An instance of LROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = 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, - autonomousdatabasename=autonomousdatabasename, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - properties: Union[_models.AutonomousDatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "AutonomousDatabaseUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - properties: _models.AutonomousDatabaseUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Update a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdate - :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 AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Update a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - autonomousdatabasename: str, - properties: Union[_models.AutonomousDatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Update a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param properties: The resource properties to be updated. Is either a AutonomousDatabaseUpdate - type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdate or IO[bytes] - :return: An instance of LROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any) -> LROPoller[None]: - """Delete a AutonomousDatabase. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _failover_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.PeerDbDetails, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "PeerDbDetails") - - _request = build_failover_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_failover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: _models.PeerDbDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Perform failover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails - :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 AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_failover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Perform failover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: 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 AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_failover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.PeerDbDetails, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Perform failover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Is either a PeerDbDetails type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails or IO[bytes] - :return: An instance of LROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = 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._failover_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def generate_wallet( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: _models.GenerateAutonomousDatabaseWalletDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AutonomousDatabaseWalletFile: - """Generate wallet action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.GenerateAutonomousDatabaseWalletDetails - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AutonomousDatabaseWalletFile or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def generate_wallet( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AutonomousDatabaseWalletFile: - """Generate wallet action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: 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: AutonomousDatabaseWalletFile or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def generate_wallet( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.GenerateAutonomousDatabaseWalletDetails, IO[bytes]], - **kwargs: Any - ) -> _models.AutonomousDatabaseWalletFile: - """Generate wallet action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Is either a - GenerateAutonomousDatabaseWalletDetails type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.oracledatabase.models.GenerateAutonomousDatabaseWalletDetails or - IO[bytes] - :return: AutonomousDatabaseWalletFile or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabaseWalletFile] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "GenerateAutonomousDatabaseWalletDetails") - - _request = build_generate_wallet_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("AutonomousDatabaseWalletFile", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _restore_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.RestoreAutonomousDatabaseDetails, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "RestoreAutonomousDatabaseDetails") - - _request = build_restore_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_restore( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: _models.RestoreAutonomousDatabaseDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Restores an Autonomous Database based on the provided request parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.RestoreAutonomousDatabaseDetails - :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 AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_restore( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Restores an Autonomous Database based on the provided request parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: 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 AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_restore( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.RestoreAutonomousDatabaseDetails, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Restores an Autonomous Database based on the provided request parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Is either a RestoreAutonomousDatabaseDetails - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.oracledatabase.models.RestoreAutonomousDatabaseDetails or IO[bytes] - :return: An instance of LROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = 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._restore_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _shrink_initial( - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - _request = build_shrink_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_shrink( - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """This operation shrinks the current allocated storage down to the current actual used data - storage. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :return: An instance of LROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AutonomousDatabase] = 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._shrink_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _switchover_initial( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.PeerDbDetails, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "PeerDbDetails") - - _request = build_switchover_request( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_switchover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: _models.PeerDbDetails, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Perform switchover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails - :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 AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_switchover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Perform switchover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Required. - :type body: 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 AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_switchover( - self, - resource_group_name: str, - autonomousdatabasename: str, - body: Union[_models.PeerDbDetails, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.AutonomousDatabase]: - """Perform switchover action on Autonomous Database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param autonomousdatabasename: The database name. Required. - :type autonomousdatabasename: str - :param body: The content of the action request. Is either a PeerDbDetails type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails or IO[bytes] - :return: An instance of LROPoller that returns either AutonomousDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AutonomousDatabase] = 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._switchover_initial( - resource_group_name=resource_group_name, - autonomousdatabasename=autonomousdatabasename, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AutonomousDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AutonomousDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_exadata_infrastructures_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_exadata_infrastructures_operations.py deleted file mode 100644 index c8063deb2c92..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_exadata_infrastructures_operations.py +++ /dev/null @@ -1,1145 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/cloudExadataInfrastructures" - ) # pylint: disable=line-too-long - 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, cloudexadatainfrastructurename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudexadatainfrastructurename": _SERIALIZER.url( - "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "str", pattern=r".*" - ), - } - - _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, cloudexadatainfrastructurename: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudexadatainfrastructurename": _SERIALIZER.url( - "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "str", pattern=r".*" - ), - } - - _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_update_request( - resource_group_name: str, cloudexadatainfrastructurename: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudexadatainfrastructurename": _SERIALIZER.url( - "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "str", pattern=r".*" - ), - } - - _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_delete_request( - resource_group_name: str, cloudexadatainfrastructurename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudexadatainfrastructurename": _SERIALIZER.url( - "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "str", pattern=r".*" - ), - } - - _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_add_storage_capacity_request( - resource_group_name: str, cloudexadatainfrastructurename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/addStorageCapacity", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudexadatainfrastructurename": _SERIALIZER.url( - "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "str", pattern=r".*" - ), - } - - _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 CloudExadataInfrastructuresOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`cloud_exadata_infrastructures` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CloudExadataInfrastructure"]: - """List CloudExadataInfrastructure resources by subscription ID. - - :return: An iterator like instance of either CloudExadataInfrastructure or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudExadataInfrastructureListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructureListResult", 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.CloudExadataInfrastructure"]: - """List CloudExadataInfrastructure resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either CloudExadataInfrastructure or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudExadataInfrastructureListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_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 = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructureListResult", 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( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> _models.CloudExadataInfrastructure: - """Get a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :return: CloudExadataInfrastructure or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("CloudExadataInfrastructure", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - resource: Union[_models.CloudExadataInfrastructure, IO[bytes]], - **kwargs: Any - ) -> _models.CloudExadataInfrastructure: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "CloudExadataInfrastructure") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - resource: _models.CloudExadataInfrastructure, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudExadataInfrastructure]: - """Create a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure - :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 CloudExadataInfrastructure or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudExadataInfrastructure]: - """Create a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either CloudExadataInfrastructure or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - resource: Union[_models.CloudExadataInfrastructure, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CloudExadataInfrastructure]: - """Create a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param resource: Resource create parameters. Is either a CloudExadataInfrastructure type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure or IO[bytes] - :return: An instance of LROPoller that returns either CloudExadataInfrastructure or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudExadataInfrastructure] = 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, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CloudExadataInfrastructure].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CloudExadataInfrastructure]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - properties: Union[_models.CloudExadataInfrastructureUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.CloudExadataInfrastructure]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CloudExadataInfrastructure]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "CloudExadataInfrastructureUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - properties: _models.CloudExadataInfrastructureUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudExadataInfrastructure]: - """Update a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdate - :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 CloudExadataInfrastructure or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudExadataInfrastructure]: - """Update a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 CloudExadataInfrastructure or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - cloudexadatainfrastructurename: str, - properties: Union[_models.CloudExadataInfrastructureUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CloudExadataInfrastructure]: - """Update a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param properties: The resource properties to be updated. Is either a - CloudExadataInfrastructureUpdate type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdate or - IO[bytes] - :return: An instance of LROPoller that returns either CloudExadataInfrastructure or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CloudExadataInfrastructure].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CloudExadataInfrastructure]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _add_storage_capacity_initial( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> Optional[_models.CloudExadataInfrastructure]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.CloudExadataInfrastructure]] = kwargs.pop("cls", None) - - _request = build_add_storage_capacity_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_add_storage_capacity( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> LROPoller[_models.CloudExadataInfrastructure]: - """Perform add storage capacity on exadata infra. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :return: An instance of LROPoller that returns either CloudExadataInfrastructure or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudExadataInfrastructure] = 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._add_storage_capacity_initial( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CloudExadataInfrastructure].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CloudExadataInfrastructure]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_vm_clusters_operations.py deleted file mode 100644 index ce4460ba2548..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_vm_clusters_operations.py +++ /dev/null @@ -1,1601 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/cloudVmClusters") - 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - } - - _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, cloudvmclustername: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - } - - _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_update_request( - resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - } - - _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_delete_request( - resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - } - - _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_add_vms_request( - resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/addVms", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - } - - _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_private_ip_addresses_request( - resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/listPrivateIpAddresses", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - } - - _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_remove_vms_request( - resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/removeVms", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - } - - _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 CloudVmClustersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`cloud_vm_clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CloudVmCluster"]: - """List CloudVmCluster resources by subscription ID. - - :return: An iterator like instance of either CloudVmCluster or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudVmClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CloudVmClusterListResult", 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.CloudVmCluster"]: - """List CloudVmCluster resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either CloudVmCluster or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudVmClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_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 = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CloudVmClusterListResult", 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(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) -> _models.CloudVmCluster: - """Get a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :return: CloudVmCluster or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.CloudVmCluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("CloudVmCluster", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - resource: Union[_models.CloudVmCluster, IO[bytes]], - **kwargs: Any - ) -> _models.CloudVmCluster: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "CloudVmCluster") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - resource: _models.CloudVmCluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Create a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.CloudVmCluster - :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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Create a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - resource: Union[_models.CloudVmCluster, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Create a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param resource: Resource create parameters. Is either a CloudVmCluster type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.CloudVmCluster or IO[bytes] - :return: An instance of LROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = 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, - cloudvmclustername=cloudvmclustername, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CloudVmCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CloudVmCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - properties: Union[_models.CloudVmClusterUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "CloudVmClusterUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - cloudvmclustername: str, - properties: _models.CloudVmClusterUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Update a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdate - :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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - cloudvmclustername: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Update a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param properties: The resource properties to be updated. Required. - :type properties: 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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - cloudvmclustername: str, - properties: Union[_models.CloudVmClusterUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Update a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param properties: The resource properties to be updated. Is either a CloudVmClusterUpdate type - or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdate or IO[bytes] - :return: An instance of LROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CloudVmCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CloudVmCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) -> LROPoller[None]: - """Delete a CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _add_vms_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.AddRemoveDbNode, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "AddRemoveDbNode") - - _request = build_add_vms_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_add_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: _models.AddRemoveDbNode, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Add VMs to the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode - :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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_add_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Add VMs to the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: 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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_add_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.AddRemoveDbNode, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Add VMs to the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Is either a AddRemoveDbNode type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode or IO[bytes] - :return: An instance of LROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = 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._add_vms_initial( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CloudVmCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CloudVmCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def list_private_ip_addresses( - self, - resource_group_name: str, - cloudvmclustername: str, - body: _models.PrivateIpAddressesFilter, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> List[_models.PrivateIpAddressProperties]: - """List Private IP Addresses by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.PrivateIpAddressesFilter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: list of PrivateIpAddressProperties or the result of cls(response) - :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def list_private_ip_addresses( - self, - resource_group_name: str, - cloudvmclustername: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> List[_models.PrivateIpAddressProperties]: - """List Private IP Addresses by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: 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: list of PrivateIpAddressProperties or the result of cls(response) - :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def list_private_ip_addresses( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.PrivateIpAddressesFilter, IO[bytes]], - **kwargs: Any - ) -> List[_models.PrivateIpAddressProperties]: - """List Private IP Addresses by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Is either a PrivateIpAddressesFilter type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.oracledatabase.models.PrivateIpAddressesFilter or IO[bytes] - :return: list of PrivateIpAddressProperties or the result of cls(response) - :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[List[_models.PrivateIpAddressProperties]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "PrivateIpAddressesFilter") - - _request = build_list_private_ip_addresses_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("[PrivateIpAddressProperties]", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _remove_vms_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.AddRemoveDbNode, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "AddRemoveDbNode") - - _request = build_remove_vms_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_remove_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: _models.AddRemoveDbNode, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Remove VMs from the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode - :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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_remove_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Remove VMs from the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Required. - :type body: 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 CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_remove_vms( - self, - resource_group_name: str, - cloudvmclustername: str, - body: Union[_models.AddRemoveDbNode, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CloudVmCluster]: - """Remove VMs from the VM Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param body: The content of the action request. Is either a AddRemoveDbNode type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode or IO[bytes] - :return: An instance of LROPoller that returns either CloudVmCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CloudVmCluster] = 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._remove_vms_initial( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CloudVmCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CloudVmCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_nodes_operations.py deleted file mode 100644 index 555a3e19530b..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_nodes_operations.py +++ /dev/null @@ -1,520 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_cloud_vm_cluster_request( - resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, cloudvmclustername: str, dbnodeocid: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - "dbnodeocid": _SERIALIZER.url("dbnodeocid", dbnodeocid, "str", max_length=255, min_length=1, pattern=r".*"), - } - - _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_action_request( - resource_group_name: str, cloudvmclustername: str, dbnodeocid: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}/action", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - "dbnodeocid": _SERIALIZER.url("dbnodeocid", dbnodeocid, "str", max_length=255, min_length=1, pattern=r".*"), - } - - _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 DbNodesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`db_nodes` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cloud_vm_cluster( - self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any - ) -> Iterable["_models.DbNode"]: - """List DbNode resources by CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :return: An iterator like instance of either DbNode or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DbNode] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbNodeListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_cloud_vm_cluster_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DbNodeListResult", 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(self, resource_group_name: str, cloudvmclustername: str, dbnodeocid: str, **kwargs: Any) -> _models.DbNode: - """Get a DbNode. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param dbnodeocid: DbNode OCID. Required. - :type dbnodeocid: str - :return: DbNode or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DbNode - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbNode] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - dbnodeocid=dbnodeocid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DbNode", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _action_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - dbnodeocid: str, - body: Union[_models.DbNodeAction, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.DbNode]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.DbNode]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "DbNodeAction") - - _request = build_action_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - dbnodeocid=dbnodeocid, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("DbNode", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_action( - self, - resource_group_name: str, - cloudvmclustername: str, - dbnodeocid: str, - body: _models.DbNodeAction, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DbNode]: - """VM actions on DbNode of VM Cluster by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param dbnodeocid: DbNode OCID. Required. - :type dbnodeocid: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction - :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 DbNode or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbNode] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_action( - self, - resource_group_name: str, - cloudvmclustername: str, - dbnodeocid: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DbNode]: - """VM actions on DbNode of VM Cluster by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param dbnodeocid: DbNode OCID. Required. - :type dbnodeocid: str - :param body: The content of the action request. Required. - :type body: 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 DbNode or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbNode] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_action( - self, - resource_group_name: str, - cloudvmclustername: str, - dbnodeocid: str, - body: Union[_models.DbNodeAction, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DbNode]: - """VM actions on DbNode of VM Cluster by the provided filter. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param dbnodeocid: DbNode OCID. Required. - :type dbnodeocid: str - :param body: The content of the action request. Is either a DbNodeAction type or a IO[bytes] - type. Required. - :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction or IO[bytes] - :return: An instance of LROPoller that returns either DbNode or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbNode] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DbNode] = 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._action_initial( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - dbnodeocid=dbnodeocid, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DbNode", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DbNode].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DbNode]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_servers_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_servers_operations.py deleted file mode 100644 index dcd9b8d17403..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_servers_operations.py +++ /dev/null @@ -1,286 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_cloud_exadata_infrastructure_request( # pylint: disable=name-too-long - resource_group_name: str, cloudexadatainfrastructurename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudexadatainfrastructurename": _SERIALIZER.url( - "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "str", pattern=r".*" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - cloudexadatainfrastructurename: str, - dbserverocid: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudexadatainfrastructurename": _SERIALIZER.url( - "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "str", pattern=r".*" - ), - "dbserverocid": _SERIALIZER.url( - "dbserverocid", dbserverocid, "str", max_length=255, min_length=1, pattern=r".*" - ), - } - - _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 DbServersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`db_servers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cloud_exadata_infrastructure( - self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> Iterable["_models.DbServer"]: - """List DbServer resources by CloudExadataInfrastructure. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :return: An iterator like instance of either DbServer or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DbServer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_cloud_exadata_infrastructure_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DbServerListResult", 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( - self, resource_group_name: str, cloudexadatainfrastructurename: str, dbserverocid: str, **kwargs: Any - ) -> _models.DbServer: - """Get a DbServer. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. - :type cloudexadatainfrastructurename: str - :param dbserverocid: DbServer OCID. Required. - :type dbserverocid: str - :return: DbServer or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DbServer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbServer] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudexadatainfrastructurename=cloudexadatainfrastructurename, - dbserverocid=dbserverocid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DbServer", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_system_shapes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_system_shapes_operations.py deleted file mode 100644 index 97e366ce296a..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_system_shapes_operations.py +++ /dev/null @@ -1,253 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location: str, dbsystemshapename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "dbsystemshapename": _SERIALIZER.url("dbsystemshapename", dbsystemshapename, "str", pattern=r".*"), - } - - _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 DbSystemShapesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`db_system_shapes` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.DbSystemShape"]: - """List DbSystemShape resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either DbSystemShape or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DbSystemShape] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbSystemShapeListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DbSystemShapeListResult", 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(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _models.DbSystemShape: - """Get a DbSystemShape. - - :param location: The name of the Azure region. Required. - :type location: str - :param dbsystemshapename: DbSystemShape name. Required. - :type dbsystemshapename: str - :return: DbSystemShape or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DbSystemShape - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DbSystemShape] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - dbsystemshapename=dbsystemshapename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DbSystemShape", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_views_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_views_operations.py deleted file mode 100644 index 346b6c6dcb70..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_views_operations.py +++ /dev/null @@ -1,255 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location: str, dnsprivateviewocid: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "dnsprivateviewocid": _SERIALIZER.url( - "dnsprivateviewocid", dnsprivateviewocid, "str", max_length=255, min_length=1, pattern=r".*" - ), - } - - _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 DnsPrivateViewsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`dns_private_views` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.DnsPrivateView"]: - """List DnsPrivateView resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either DnsPrivateView or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DnsPrivateView] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DnsPrivateViewListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DnsPrivateViewListResult", 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(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _models.DnsPrivateView: - """Get a DnsPrivateView. - - :param location: The name of the Azure region. Required. - :type location: str - :param dnsprivateviewocid: DnsPrivateView OCID. Required. - :type dnsprivateviewocid: str - :return: DnsPrivateView or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateView - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DnsPrivateView] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - dnsprivateviewocid=dnsprivateviewocid, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DnsPrivateView", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_zones_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_zones_operations.py deleted file mode 100644 index ef4a951b72d5..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_zones_operations.py +++ /dev/null @@ -1,253 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location: str, dnsprivatezonename: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "dnsprivatezonename": _SERIALIZER.url("dnsprivatezonename", dnsprivatezonename, "str", pattern=r".*"), - } - - _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 DnsPrivateZonesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`dns_private_zones` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.DnsPrivateZone"]: - """List DnsPrivateZone resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either DnsPrivateZone or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DnsPrivateZone] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DnsPrivateZoneListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DnsPrivateZoneListResult", 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(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _models.DnsPrivateZone: - """Get a DnsPrivateZone. - - :param location: The name of the Azure region. Required. - :type location: str - :param dnsprivatezonename: DnsPrivateZone name. Required. - :type dnsprivatezonename: str - :return: DnsPrivateZone or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateZone - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DnsPrivateZone] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - dnsprivatezonename=dnsprivatezonename, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("DnsPrivateZone", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_versions_operations.py deleted file mode 100644 index 3fc75e088a2d..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_versions_operations.py +++ /dev/null @@ -1,253 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location: str, giversionname: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "giversionname": _SERIALIZER.url("giversionname", giversionname, "str", pattern=r".*"), - } - - _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 GiVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`gi_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.GiVersion"]: - """List GiVersion resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either GiVersion or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.GiVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GiVersionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GiVersionListResult", 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(self, location: str, giversionname: str, **kwargs: Any) -> _models.GiVersion: - """Get a GiVersion. - - :param location: The name of the Azure region. Required. - :type location: str - :param giversionname: GiVersion name. Required. - :type giversionname: str - :return: GiVersion or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.GiVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GiVersion] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - giversionname=giversionname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("GiVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_operations.py index 86d4cb7c1c42..b766450973b6 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_operations.py @@ -1,55 +1,2623 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, Callable, Dict, IO, Iterator, List, 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.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._validation import api_version_validation -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_request(**kwargs: Any) -> HttpRequest: +def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Oracle.Database/operations") + _url = "/providers/Oracle.Database/operations" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_cloud_exadata_infrastructures_list_by_subscription_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/cloudExadataInfrastructures" + 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_cloud_exadata_infrastructures_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, cloudexadatainfrastructurename: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudexadatainfrastructurename": _SERIALIZER.url( + "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "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_cloud_exadata_infrastructures_get_request( # pylint: disable=name-too-long + resource_group_name: str, cloudexadatainfrastructurename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudexadatainfrastructurename": _SERIALIZER.url( + "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "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_cloud_exadata_infrastructures_update_request( # pylint: disable=name-too-long + resource_group_name: str, cloudexadatainfrastructurename: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudexadatainfrastructurename": _SERIALIZER.url( + "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "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_cloud_exadata_infrastructures_delete_request( # pylint: disable=name-too-long + resource_group_name: str, cloudexadatainfrastructurename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudexadatainfrastructurename": _SERIALIZER.url( + "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "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_cloud_exadata_infrastructures_list_by_resource_group_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_cloud_exadata_infrastructures_add_storage_capacity_request( # pylint: disable=name-too-long + resource_group_name: str, cloudexadatainfrastructurename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/addStorageCapacity" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudexadatainfrastructurename": _SERIALIZER.url( + "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "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_db_servers_get_request( + resource_group_name: str, + cloudexadatainfrastructurename: str, + dbserverocid: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudexadatainfrastructurename": _SERIALIZER.url( + "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "str" + ), + "dbserverocid": _SERIALIZER.url("dbserverocid", dbserverocid, "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_db_servers_list_by_parent_request( + resource_group_name: str, cloudexadatainfrastructurename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudexadatainfrastructurename": _SERIALIZER.url( + "cloudexadatainfrastructurename", cloudexadatainfrastructurename, "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_cloud_vm_clusters_list_by_subscription_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/cloudVmClusters" + 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_cloud_vm_clusters_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, cloudvmclustername: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "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_cloud_vm_clusters_get_request( + resource_group_name: str, cloudvmclustername: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "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_cloud_vm_clusters_update_request( + resource_group_name: str, cloudvmclustername: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "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_cloud_vm_clusters_delete_request( + resource_group_name: str, cloudvmclustername: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "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_cloud_vm_clusters_list_by_resource_group_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_cloud_vm_clusters_add_vms_request( + resource_group_name: str, cloudvmclustername: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/addVms" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "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_cloud_vm_clusters_remove_vms_request( # pylint: disable=name-too-long + resource_group_name: str, cloudvmclustername: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/removeVms" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "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_cloud_vm_clusters_list_private_ip_addresses_request( # pylint: disable=name-too-long + resource_group_name: str, cloudvmclustername: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/listPrivateIpAddresses" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "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_virtual_network_addresses_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str"), + "virtualnetworkaddressname": _SERIALIZER.url("virtualnetworkaddressname", virtualnetworkaddressname, "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_virtual_network_addresses_get_request( # pylint: disable=name-too-long + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str"), + "virtualnetworkaddressname": _SERIALIZER.url("virtualnetworkaddressname", virtualnetworkaddressname, "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_virtual_network_addresses_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str"), + "virtualnetworkaddressname": _SERIALIZER.url("virtualnetworkaddressname", virtualnetworkaddressname, "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_virtual_network_addresses_list_by_parent_request( # pylint: disable=name-too-long + resource_group_name: str, cloudvmclustername: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "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_system_versions_get_request( + location: str, systemversionname: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "systemversionname": _SERIALIZER.url("systemversionname", systemversionname, "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_system_versions_list_by_location_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "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_oracle_subscriptions_list_by_subscription_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions" + 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_oracle_subscriptions_create_or_update_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" + 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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_oracle_subscriptions_get_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" + 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_oracle_subscriptions_update_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" + 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_oracle_subscriptions_delete_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" + 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_oracle_subscriptions_list_cloud_account_details_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listCloudAccountDetails" + ) + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_oracle_subscriptions_list_saas_subscription_details_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listSaasSubscriptionDetails" + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_oracle_subscriptions_list_activation_links_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listActivationLinks" + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_oracle_subscriptions_add_azure_subscriptions_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions" + 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) + + +def build_db_nodes_get_request( + resource_group_name: str, cloudvmclustername: str, dbnodeocid: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str"), + "dbnodeocid": _SERIALIZER.url("dbnodeocid", dbnodeocid, "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_db_nodes_list_by_parent_request( + resource_group_name: str, cloudvmclustername: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "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_db_nodes_action_request( + resource_group_name: str, cloudvmclustername: str, dbnodeocid: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}/action" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str"), + "dbnodeocid": _SERIALIZER.url("dbnodeocid", dbnodeocid, "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_gi_versions_get_request( + location: str, giversionname: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "giversionname": _SERIALIZER.url("giversionname", giversionname, "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_gi_versions_list_by_location_request( # pylint: disable=name-too-long + location: str, + subscription_id: str, + *, + shape: Optional[Union[str, _models.SystemShapes]] = None, + zone: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if shape is not None: + _params["shape"] = _SERIALIZER.query("shape", shape, "str") + if zone is not None: + _params["zone"] = _SERIALIZER.query("zone", zone, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_gi_minor_versions_list_by_parent_request( # pylint: disable=name-too-long + location: str, + giversionname: str, + subscription_id: str, + *, + shape_family: Optional[Union[str, _models.ShapeFamily]] = None, + zone: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "giversionname": _SERIALIZER.url("giversionname", giversionname, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if shape_family is not None: + _params["shapeFamily"] = _SERIALIZER.query("shape_family", shape_family, "str") + if zone is not None: + _params["zone"] = _SERIALIZER.query("zone", zone, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_gi_minor_versions_get_request( + location: str, giversionname: str, gi_minor_version_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "giversionname": _SERIALIZER.url("giversionname", giversionname, "str"), + "giMinorVersionName": _SERIALIZER.url("gi_minor_version_name", gi_minor_version_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_db_system_shapes_get_request( + location: str, dbsystemshapename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "dbsystemshapename": _SERIALIZER.url("dbsystemshapename", dbsystemshapename, "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_db_system_shapes_list_by_location_request( # pylint: disable=name-too-long + location: str, subscription_id: str, *, zone: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if zone is not None: + _params["zone"] = _SERIALIZER.query("zone", zone, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_dns_private_views_get_request( + location: str, dnsprivateviewocid: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "dnsprivateviewocid": _SERIALIZER.url("dnsprivateviewocid", dnsprivateviewocid, "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_dns_private_views_list_by_location_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "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_dns_private_zones_get_request( + location: str, dnsprivatezonename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "dnsprivatezonename": _SERIALIZER.url("dnsprivatezonename", dnsprivatezonename, "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_dns_private_zones_list_by_location_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "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_flex_components_get_request( + location: str, flex_component_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "flexComponentName": _SERIALIZER.url("flex_component_name", flex_component_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_flex_components_list_by_parent_request( # pylint: disable=name-too-long + location: str, subscription_id: str, *, shape: Optional[Union[str, _models.SystemShapes]] = 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if shape is not None: + _params["shape"] = _SERIALIZER.query("shape", shape, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_autonomous_databases_list_by_subscription_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/autonomousDatabases" + 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_autonomous_databases_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_databases_get_request( + resource_group_name: str, autonomousdatabasename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_databases_delete_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_databases_update_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_databases_list_by_resource_group_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_autonomous_databases_switchover_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/switchover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_databases_failover_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_databases_generate_wallet_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/generateWallet" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_databases_restore_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/restore" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_databases_shrink_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/shrink" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_databases_change_disaster_recovery_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/changeDisasterRecoveryConfiguration" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_database_backups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "str"), + "adbbackupid": _SERIALIZER.url("adbbackupid", adbbackupid, "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_autonomous_database_backups_get_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, adbbackupid: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "str"), + "adbbackupid": _SERIALIZER.url("adbbackupid", adbbackupid, "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_autonomous_database_backups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, adbbackupid: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "str"), + "adbbackupid": _SERIALIZER.url("adbbackupid", adbbackupid, "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_autonomous_database_backups_update_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "str"), + "adbbackupid": _SERIALIZER.url("adbbackupid", adbbackupid, "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_autonomous_database_backups_list_by_parent_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "autonomousdatabasename": _SERIALIZER.url("autonomousdatabasename", autonomousdatabasename, "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_autonomous_database_character_sets_get_request( # pylint: disable=name-too-long + location: str, adbscharsetname: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "adbscharsetname": _SERIALIZER.url("adbscharsetname", adbscharsetname, "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_autonomous_database_character_sets_list_by_location_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "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_autonomous_database_national_character_sets_get_request( # pylint: disable=name-too-long + location: str, adbsncharsetname: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "adbsncharsetname": _SERIALIZER.url("adbsncharsetname", adbsncharsetname, "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_autonomous_database_national_character_sets_list_by_location_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "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_autonomous_database_versions_get_request( # pylint: disable=name-too-long + location: str, autonomousdbversionsname: 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "autonomousdbversionsname": _SERIALIZER.url("autonomousdbversionsname", autonomousdbversionsname, "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_autonomous_database_versions_list_by_location_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "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_exadb_vm_clusters_list_by_subscription_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters" + 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_exadb_vm_clusters_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, exadb_vm_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_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_exadb_vm_clusters_get_request( + resource_group_name: str, exadb_vm_cluster_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exadb_vm_clusters_update_request( + resource_group_name: str, exadb_vm_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exadb_vm_clusters_delete_request( + resource_group_name: str, exadb_vm_cluster_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_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_exadb_vm_clusters_list_by_resource_group_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exadb_vm_clusters_remove_vms_request( # pylint: disable=name-too-long + resource_group_name: str, exadb_vm_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/removeVms" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exascale_db_nodes_get_request( + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str"), + "exascaleDbNodeName": _SERIALIZER.url("exascale_db_node_name", exascale_db_node_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exascale_db_nodes_list_by_parent_request( # pylint: disable=name-too-long + resource_group_name: str, exadb_vm_cluster_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exascale_db_nodes_action_request( + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}/action" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str"), + "exascaleDbNodeName": _SERIALIZER.url("exascale_db_node_name", exascale_db_node_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exascale_db_storage_vaults_get_request( # pylint: disable=name-too-long + resource_group_name: str, exascale_db_storage_vault_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exascaleDbStorageVaultName": _SERIALIZER.url( + "exascale_db_storage_vault_name", exascale_db_storage_vault_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exascale_db_storage_vaults_create_request( # pylint: disable=name-too-long + resource_group_name: str, exascale_db_storage_vault_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exascaleDbStorageVaultName": _SERIALIZER.url( + "exascale_db_storage_vault_name", exascale_db_storage_vault_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_exascale_db_storage_vaults_update_request( # pylint: disable=name-too-long + resource_group_name: str, exascale_db_storage_vault_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exascaleDbStorageVaultName": _SERIALIZER.url( + "exascale_db_storage_vault_name", exascale_db_storage_vault_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exascale_db_storage_vaults_delete_request( # pylint: disable=name-too-long + resource_group_name: str, exascale_db_storage_vault_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "exascaleDbStorageVaultName": _SERIALIZER.url( + "exascale_db_storage_vault_name", exascale_db_storage_vault_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_exascale_db_storage_vaults_list_by_resource_group_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_exascale_db_storage_vaults_list_by_subscription_request( # pylint: disable=name-too-long + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults" + 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") @@ -67,33 +2635,12073 @@ class Operations: Instead, you should access the following operations through :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`operations` attribute. + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = 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_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class CloudExadataInfrastructuresOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`cloud_exadata_infrastructures` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.CloudExadataInfrastructure"]: + """List CloudExadataInfrastructure resources by subscription ID. + + :return: An iterator like instance of CloudExadataInfrastructure + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.CloudExadataInfrastructure]] = 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_cloud_exadata_infrastructures_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.CloudExadataInfrastructure], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + 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, + cloudexadatainfrastructurename: str, + resource: Union[_models.CloudExadataInfrastructure, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_exadata_infrastructures_create_or_update_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + resource: _models.CloudExadataInfrastructure, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudExadataInfrastructure]: + """Create a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure + :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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudExadataInfrastructure]: + """Create a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudExadataInfrastructure]: + """Create a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + resource: Union[_models.CloudExadataInfrastructure, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CloudExadataInfrastructure]: + """Create a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param resource: Resource create parameters. Is one of the following types: + CloudExadataInfrastructure, JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure or JSON or + IO[bytes] + :return: An instance of LROPoller that returns CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudExadataInfrastructure] = 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, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudExadataInfrastructure, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CloudExadataInfrastructure].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CloudExadataInfrastructure]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any + ) -> _models.CloudExadataInfrastructure: + """Get a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :return: CloudExadataInfrastructure. The CloudExadataInfrastructure is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) + + _request = build_cloud_exadata_infrastructures_get_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.CloudExadataInfrastructure, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_initial( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: Union[_models.CloudExadataInfrastructureUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_exadata_infrastructures_update_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: _models.CloudExadataInfrastructureUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudExadataInfrastructure]: + """Update a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdate + :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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudExadataInfrastructure]: + """Update a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudExadataInfrastructure]: + """Update a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cloudexadatainfrastructurename: str, + properties: Union[_models.CloudExadataInfrastructureUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CloudExadataInfrastructure]: + """Update a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param properties: The resource properties to be updated. Is one of the following types: + CloudExadataInfrastructureUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdate or JSON or + IO[bytes] + :return: An instance of LROPoller that returns CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudExadataInfrastructure] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudExadataInfrastructure, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CloudExadataInfrastructure].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CloudExadataInfrastructure]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, cloudexadatainfrastructurename: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_cloud_exadata_infrastructures_delete_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + 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 + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.CloudExadataInfrastructure"]: + """List CloudExadataInfrastructure resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of CloudExadataInfrastructure + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.CloudExadataInfrastructure]] = 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_cloud_exadata_infrastructures_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.CloudExadataInfrastructure], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _add_storage_capacity_initial( + self, resource_group_name: str, cloudexadatainfrastructurename: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_cloud_exadata_infrastructures_add_storage_capacity_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_add_storage_capacity( + self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any + ) -> LROPoller[_models.CloudExadataInfrastructure]: + """Perform add storage capacity on exadata infra. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :return: An instance of LROPoller that returns CloudExadataInfrastructure. The + CloudExadataInfrastructure is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CloudExadataInfrastructure] = 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._add_storage_capacity_initial( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CloudExadataInfrastructure, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CloudExadataInfrastructure].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CloudExadataInfrastructure]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ListActionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`list_actions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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") + + +class DbServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`db_servers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cloudexadatainfrastructurename: str, dbserverocid: str, **kwargs: Any + ) -> _models.DbServer: + """Get a DbServer. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :param dbserverocid: DbServer OCID. Required. + :type dbserverocid: str + :return: DbServer. The DbServer is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DbServer + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DbServer] = kwargs.pop("cls", None) + + _request = build_db_servers_get_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + dbserverocid=dbserverocid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DbServer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_parent( + self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any + ) -> ItemPaged["_models.DbServer"]: + """List DbServer resources by CloudExadataInfrastructure. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudexadatainfrastructurename: CloudExadataInfrastructure name. Required. + :type cloudexadatainfrastructurename: str + :return: An iterator like instance of DbServer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DbServer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DbServer]] = 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_db_servers_list_by_parent_request( + resource_group_name=resource_group_name, + cloudexadatainfrastructurename=cloudexadatainfrastructurename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DbServer], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class CloudVmClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`cloud_vm_clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.CloudVmCluster"]: + """List CloudVmCluster resources by subscription ID. + + :return: An iterator like instance of CloudVmCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.CloudVmCluster]] = 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_cloud_vm_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.CloudVmCluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + 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, + cloudvmclustername: str, + resource: Union[_models.CloudVmCluster, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_create_or_update_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + resource: _models.CloudVmCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Create a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.CloudVmCluster + :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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Create a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Create a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + resource: Union[_models.CloudVmCluster, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Create a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param resource: Resource create parameters. Is one of the following types: CloudVmCluster, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.CloudVmCluster or JSON or IO[bytes] + :return: An instance of LROPoller that returns CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudVmCluster] = 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, + cloudvmclustername=cloudvmclustername, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CloudVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CloudVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) -> _models.CloudVmCluster: + """Get a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :return: CloudVmCluster. The CloudVmCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.CloudVmCluster + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) + + _request = build_cloud_vm_clusters_get_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: Union[_models.CloudVmClusterUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_update_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: _models.CloudVmClusterUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Update a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdate + :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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Update a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Update a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cloudvmclustername: str, + properties: Union[_models.CloudVmClusterUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Update a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param properties: The resource properties to be updated. Is one of the following types: + CloudVmClusterUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudVmCluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CloudVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CloudVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, cloudvmclustername: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_cloud_vm_clusters_delete_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) -> LROPoller[None]: + """Delete a CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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, + cloudvmclustername=cloudvmclustername, + 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 + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.CloudVmCluster"]: + """List CloudVmCluster resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of CloudVmCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.CloudVmCluster]] = 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_cloud_vm_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.CloudVmCluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _add_vms_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.AddRemoveDbNode, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_add_vms_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_add_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: _models.AddRemoveDbNode, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Add VMs to the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode + :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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_add_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Add VMs to the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: JSON + :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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_add_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Add VMs to the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: 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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_add_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.AddRemoveDbNode, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Add VMs to the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Is one of the following types: AddRemoveDbNode, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode or JSON or IO[bytes] + :return: An instance of LROPoller that returns CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudVmCluster] = 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._add_vms_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CloudVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CloudVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _remove_vms_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.AddRemoveDbNode, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_remove_vms_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_remove_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: _models.AddRemoveDbNode, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode + :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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_remove_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: JSON + :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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_remove_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: 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 CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_remove_vms( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.AddRemoveDbNode, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CloudVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Is one of the following types: AddRemoveDbNode, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.AddRemoveDbNode or JSON or IO[bytes] + :return: An instance of LROPoller that returns CloudVmCluster. The CloudVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CloudVmCluster] = 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._remove_vms_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.CloudVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CloudVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CloudVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def list_private_ip_addresses( + self, + resource_group_name: str, + cloudvmclustername: str, + body: _models.PrivateIpAddressesFilter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.PrivateIpAddressProperties]: + """List Private IP Addresses by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.PrivateIpAddressesFilter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of PrivateIpAddressProperties + :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_private_ip_addresses( + self, + resource_group_name: str, + cloudvmclustername: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.PrivateIpAddressProperties]: + """List Private IP Addresses by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: list of PrivateIpAddressProperties + :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_private_ip_addresses( + self, + resource_group_name: str, + cloudvmclustername: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> List[_models.PrivateIpAddressProperties]: + """List Private IP Addresses by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Required. + :type body: 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: list of PrivateIpAddressProperties + :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_private_ip_addresses( + self, + resource_group_name: str, + cloudvmclustername: str, + body: Union[_models.PrivateIpAddressesFilter, JSON, IO[bytes]], + **kwargs: Any + ) -> List[_models.PrivateIpAddressProperties]: + """List Private IP Addresses by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param body: The content of the action request. Is one of the following types: + PrivateIpAddressesFilter, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.PrivateIpAddressesFilter or JSON or IO[bytes] + :return: list of PrivateIpAddressProperties + :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] + :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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[List[_models.PrivateIpAddressProperties]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_cloud_vm_clusters_list_private_ip_addresses_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(List[_models.PrivateIpAddressProperties], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class VirtualNetworkAddressesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`virtual_network_addresses` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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") + + def _create_or_update_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: Union[_models.VirtualNetworkAddress, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_virtual_network_addresses_create_or_update_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: _models.VirtualNetworkAddress, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkAddress]: + """Create a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress + :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 VirtualNetworkAddress. The VirtualNetworkAddress + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkAddress]: + """Create a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 VirtualNetworkAddress. The VirtualNetworkAddress + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkAddress]: + """Create a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VirtualNetworkAddress. The VirtualNetworkAddress + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cloudvmclustername: str, + virtualnetworkaddressname: str, + resource: Union[_models.VirtualNetworkAddress, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkAddress]: + """Create a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :param resource: Resource create parameters. Is one of the following types: + VirtualNetworkAddress, JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress or JSON or IO[bytes] + :return: An instance of LROPoller that returns VirtualNetworkAddress. The VirtualNetworkAddress + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkAddress] = 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, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VirtualNetworkAddress, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkAddress].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkAddress]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any + ) -> _models.VirtualNetworkAddress: + """Get a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :return: VirtualNetworkAddress. The VirtualNetworkAddress is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VirtualNetworkAddress] = kwargs.pop("cls", None) + + _request = build_virtual_network_addresses_get_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.VirtualNetworkAddress, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_virtual_network_addresses_delete_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a VirtualNetworkAddress. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param virtualnetworkaddressname: Virtual IP address hostname. Required. + :type virtualnetworkaddressname: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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, + cloudvmclustername=cloudvmclustername, + virtualnetworkaddressname=virtualnetworkaddressname, + 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 + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_parent( + self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any + ) -> ItemPaged["_models.VirtualNetworkAddress"]: + """List VirtualNetworkAddress resources by CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :return: An iterator like instance of VirtualNetworkAddress + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VirtualNetworkAddress]] = 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_virtual_network_addresses_list_by_parent_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.VirtualNetworkAddress], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SystemVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`system_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, systemversionname: str, **kwargs: Any) -> _models.SystemVersion: + """Get a SystemVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param systemversionname: SystemVersion name. Required. + :type systemversionname: str + :return: SystemVersion. The SystemVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.SystemVersion + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SystemVersion] = kwargs.pop("cls", None) + + _request = build_system_versions_get_request( + location=location, + systemversionname=systemversionname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SystemVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location: str, **kwargs: Any) -> ItemPaged["_models.SystemVersion"]: + """List SystemVersion resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of SystemVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.SystemVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SystemVersion]] = 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_system_versions_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.SystemVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class OracleSubscriptionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`oracle_subscriptions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.OracleSubscription"]: + """List OracleSubscription resources by subscription ID. + + :return: An iterator like instance of OracleSubscription + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OracleSubscription]] = 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_oracle_subscriptions_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.OracleSubscription], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + 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: Union[_models.OracleSubscription, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_oracle_subscriptions_create_or_update_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, resource: _models.OracleSubscription, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.OracleSubscription]: + """Create a OracleSubscription. + + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.OracleSubscription + :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 OracleSubscription. The OracleSubscription is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, resource: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.OracleSubscription]: + """Create a OracleSubscription. + + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 OracleSubscription. The OracleSubscription is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.OracleSubscription]: + """Create a OracleSubscription. + + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns OracleSubscription. The OracleSubscription is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, resource: Union[_models.OracleSubscription, JSON, IO[bytes]], **kwargs: Any + ) -> LROPoller[_models.OracleSubscription]: + """Create a OracleSubscription. + + :param resource: Resource create parameters. Is one of the following types: OracleSubscription, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.OracleSubscription or JSON or IO[bytes] + :return: An instance of LROPoller that returns OracleSubscription. The OracleSubscription is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OracleSubscription] = 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=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.OracleSubscription, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.OracleSubscription].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OracleSubscription]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get(self, **kwargs: Any) -> _models.OracleSubscription: + """Get a OracleSubscription. + + :return: OracleSubscription. The OracleSubscription is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.OracleSubscription + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_get_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.OracleSubscription, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_initial( + self, properties: Union[_models.OracleSubscriptionUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_oracle_subscriptions_update_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, properties: _models.OracleSubscriptionUpdate, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.OracleSubscription]: + """Update a OracleSubscription. + + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdate + :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 OracleSubscription. The OracleSubscription is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, properties: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.OracleSubscription]: + """Update a OracleSubscription. + + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 OracleSubscription. The OracleSubscription is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.OracleSubscription]: + """Update a OracleSubscription. + + :param properties: The resource properties to be updated. Required. + :type properties: 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 OracleSubscription. The OracleSubscription is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, properties: Union[_models.OracleSubscriptionUpdate, JSON, IO[bytes]], **kwargs: Any + ) -> LROPoller[_models.OracleSubscription]: + """Update a OracleSubscription. + + :param properties: The resource properties to be updated. Is one of the following types: + OracleSubscriptionUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdate or JSON or + IO[bytes] + :return: An instance of LROPoller that returns OracleSubscription. The OracleSubscription is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.OracleSubscription, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.OracleSubscription].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OracleSubscription]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, **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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_delete_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, **kwargs: Any) -> LROPoller[None]: + """Delete a OracleSubscription. + + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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(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 + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _list_cloud_account_details_initial(self, **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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_list_cloud_account_details_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_cloud_account_details(self, **kwargs: Any) -> LROPoller[_models.CloudAccountDetails]: + """List Cloud Account Details. + + :return: An instance of LROPoller that returns CloudAccountDetails. The CloudAccountDetails is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudAccountDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CloudAccountDetails] = 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._list_cloud_account_details_initial( + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CloudAccountDetails, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CloudAccountDetails].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CloudAccountDetails]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _list_saas_subscription_details_initial(self, **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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_list_saas_subscription_details_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_saas_subscription_details(self, **kwargs: Any) -> LROPoller[_models.SaasSubscriptionDetails]: + """List Saas Subscription Details. + + :return: An instance of LROPoller that returns SaasSubscriptionDetails. The + SaasSubscriptionDetails is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.SaasSubscriptionDetails] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SaasSubscriptionDetails] = 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._list_saas_subscription_details_initial( + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SaasSubscriptionDetails, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SaasSubscriptionDetails].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SaasSubscriptionDetails]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _list_activation_links_initial(self, **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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_oracle_subscriptions_list_activation_links_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_list_activation_links(self, **kwargs: Any) -> LROPoller[_models.ActivationLinks]: + """List Activation Links. + + :return: An instance of LROPoller that returns ActivationLinks. The ActivationLinks is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ActivationLinks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ActivationLinks] = 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._list_activation_links_initial( + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ActivationLinks, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ActivationLinks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ActivationLinks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-06-01-preview", + params_added_on={"2024-06-01-preview": ["api_version", "subscription_id", "content_type", "accept"]}, + ) + def _add_azure_subscriptions_initial( + self, body: Union[_models.AzureSubscriptions, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_oracle_subscriptions_add_azure_subscriptions_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_add_azure_subscriptions( + self, body: _models.AzureSubscriptions, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.AzureSubscriptions + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_add_azure_subscriptions( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_add_azure_subscriptions( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-06-01-preview", + params_added_on={"2024-06-01-preview": ["api_version", "subscription_id", "content_type", "accept"]}, + ) + def begin_add_azure_subscriptions( + self, body: Union[_models.AzureSubscriptions, JSON, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Is one of the following types: + AzureSubscriptions, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.AzureSubscriptions or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._add_azure_subscriptions_initial( + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[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 + + +class DbNodesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`db_nodes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, cloudvmclustername: str, dbnodeocid: str, **kwargs: Any) -> _models.DbNode: + """Get a DbNode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :return: DbNode. The DbNode is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DbNode + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DbNode] = kwargs.pop("cls", None) + + _request = build_db_nodes_get_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + dbnodeocid=dbnodeocid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DbNode, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_parent( + self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any + ) -> ItemPaged["_models.DbNode"]: + """List DbNode resources by CloudVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :return: An iterator like instance of DbNode + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DbNode]] = 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_db_nodes_list_by_parent_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DbNode], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _action_initial( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: Union[_models.DbNodeAction, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_db_nodes_action_request( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + dbnodeocid=dbnodeocid, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_action( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: _models.DbNodeAction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DbNode]: + """VM actions on DbNode of VM Cluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction + :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 DbNode. The DbNode is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_action( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DbNode]: + """VM actions on DbNode of VM Cluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :param body: The content of the action request. Required. + :type body: JSON + :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 DbNode. The DbNode is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_action( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DbNode]: + """VM actions on DbNode of VM Cluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :param body: The content of the action request. Required. + :type body: 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 DbNode. The DbNode is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_action( + self, + resource_group_name: str, + cloudvmclustername: str, + dbnodeocid: str, + body: Union[_models.DbNodeAction, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DbNode]: + """VM actions on DbNode of VM Cluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cloudvmclustername: CloudVmCluster name. Required. + :type cloudvmclustername: str + :param dbnodeocid: DbNode OCID. Required. + :type dbnodeocid: str + :param body: The content of the action request. Is one of the following types: DbNodeAction, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction or JSON or IO[bytes] + :return: An instance of LROPoller that returns DbNode. The DbNode is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DbNode] = 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._action_initial( + resource_group_name=resource_group_name, + cloudvmclustername=cloudvmclustername, + dbnodeocid=dbnodeocid, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DbNode, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DbNode].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DbNode]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class GiVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`gi_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, giversionname: str, **kwargs: Any) -> _models.GiVersion: + """Get a GiVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :return: GiVersion. The GiVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.GiVersion + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GiVersion] = kwargs.pop("cls", None) + + _request = build_gi_versions_get_request( + location=location, + giversionname=giversionname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.GiVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": ["api_version", "subscription_id", "location", "shape", "zone", "accept"] + }, + ) + def list_by_location( + self, + location: str, + *, + shape: Optional[Union[str, _models.SystemShapes]] = None, + zone: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.GiVersion"]: + """List GiVersion resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :keyword shape: If provided, filters the results for the given shape. Known values are: + "Exadata.X9M", "Exadata.X11M", and "ExaDbXS". Default value is None. + :paramtype shape: str or ~azure.mgmt.oracledatabase.models.SystemShapes + :keyword zone: Filters the result for the given Azure Availability Zone. Default value is None. + :paramtype zone: str + :return: An iterator like instance of GiVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.GiVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.GiVersion]] = 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_gi_versions_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + shape=shape, + zone=zone, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.GiVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class GiMinorVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`gi_minor_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "location", + "giversionname", + "shape_family", + "zone", + "accept", + ] + }, + ) + def list_by_parent( + self, + location: str, + giversionname: str, + *, + shape_family: Optional[Union[str, _models.ShapeFamily]] = None, + zone: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.GiMinorVersion"]: + """List GiMinorVersion resources by GiVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :keyword shape_family: If provided, filters the results to the set of database versions which + are supported for the given shape family. Known values are: "EXADATA" and "EXADB_XS". Default + value is None. + :paramtype shape_family: str or ~azure.mgmt.oracledatabase.models.ShapeFamily + :keyword zone: Filters the result for the given Azure Availability Zone. Default value is None. + :paramtype zone: str + :return: An iterator like instance of GiMinorVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.GiMinorVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.GiMinorVersion]] = 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_gi_minor_versions_list_by_parent_request( + location=location, + giversionname=giversionname, + subscription_id=self._config.subscription_id, + shape_family=shape_family, + zone=zone, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.GiMinorVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "location", + "giversionname", + "gi_minor_version_name", + "accept", + ] + }, + ) + def get( + self, location: str, giversionname: str, gi_minor_version_name: str, **kwargs: Any + ) -> _models.GiMinorVersion: + """Get a GiMinorVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :param gi_minor_version_name: The name of the GiMinorVersion. Required. + :type gi_minor_version_name: str + :return: GiMinorVersion. The GiMinorVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.GiMinorVersion + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GiMinorVersion] = kwargs.pop("cls", None) + + _request = build_gi_minor_versions_get_request( + location=location, + giversionname=giversionname, + gi_minor_version_name=gi_minor_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.GiMinorVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DbSystemShapesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`db_system_shapes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _models.DbSystemShape: + """Get a DbSystemShape. + + :param location: The name of the Azure region. Required. + :type location: str + :param dbsystemshapename: DbSystemShape name. Required. + :type dbsystemshapename: str + :return: DbSystemShape. The DbSystemShape is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DbSystemShape + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DbSystemShape] = kwargs.pop("cls", None) + + _request = build_db_system_shapes_get_request( + location=location, + dbsystemshapename=dbsystemshapename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DbSystemShape, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "location", "zone", "accept"]}, + ) + def list_by_location( + self, location: str, *, zone: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.DbSystemShape"]: + """List DbSystemShape resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :keyword zone: Filters the result for the given Azure Availability Zone. Default value is None. + :paramtype zone: str + :return: An iterator like instance of DbSystemShape + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DbSystemShape] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DbSystemShape]] = 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_db_system_shapes_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + zone=zone, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DbSystemShape], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DnsPrivateViewsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`dns_private_views` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _models.DnsPrivateView: + """Get a DnsPrivateView. + + :param location: The name of the Azure region. Required. + :type location: str + :param dnsprivateviewocid: DnsPrivateView OCID. Required. + :type dnsprivateviewocid: str + :return: DnsPrivateView. The DnsPrivateView is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateView + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DnsPrivateView] = kwargs.pop("cls", None) + + _request = build_dns_private_views_get_request( + location=location, + dnsprivateviewocid=dnsprivateviewocid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DnsPrivateView, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location: str, **kwargs: Any) -> ItemPaged["_models.DnsPrivateView"]: + """List DnsPrivateView resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of DnsPrivateView + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DnsPrivateView] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DnsPrivateView]] = 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_dns_private_views_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DnsPrivateView], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DnsPrivateZonesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`dns_private_zones` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _models.DnsPrivateZone: + """Get a DnsPrivateZone. + + :param location: The name of the Azure region. Required. + :type location: str + :param dnsprivatezonename: DnsPrivateZone name. Required. + :type dnsprivatezonename: str + :return: DnsPrivateZone. The DnsPrivateZone is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateZone + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DnsPrivateZone] = kwargs.pop("cls", None) + + _request = build_dns_private_zones_get_request( + location=location, + dnsprivatezonename=dnsprivatezonename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.DnsPrivateZone, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location: str, **kwargs: Any) -> ItemPaged["_models.DnsPrivateZone"]: + """List DnsPrivateZone resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of DnsPrivateZone + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DnsPrivateZone] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DnsPrivateZone]] = 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_dns_private_zones_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DnsPrivateZone], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class FlexComponentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`flex_components` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-01-01-preview", + params_added_on={ + "2025-01-01-preview": ["api_version", "subscription_id", "location", "flex_component_name", "accept"] + }, + ) + def get(self, location: str, flex_component_name: str, **kwargs: Any) -> _models.FlexComponent: + """Get a FlexComponent. + + :param location: The name of the Azure region. Required. + :type location: str + :param flex_component_name: The name of the FlexComponent. Required. + :type flex_component_name: str + :return: FlexComponent. The FlexComponent is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.FlexComponent + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FlexComponent] = kwargs.pop("cls", None) + + _request = build_flex_components_get_request( + location=location, + flex_component_name=flex_component_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.FlexComponent, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-01-01-preview", + params_added_on={"2025-01-01-preview": ["api_version", "subscription_id", "location", "shape", "accept"]}, + ) + def list_by_parent( + self, location: str, *, shape: Optional[Union[str, _models.SystemShapes]] = None, **kwargs: Any + ) -> ItemPaged["_models.FlexComponent"]: + """List FlexComponent resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :keyword shape: If provided, filters the results for the given shape. Known values are: + "Exadata.X9M", "Exadata.X11M", and "ExaDbXS". Default value is None. + :paramtype shape: str or ~azure.mgmt.oracledatabase.models.SystemShapes + :return: An iterator like instance of FlexComponent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.FlexComponent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FlexComponent]] = 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_flex_components_list_by_parent_request( + location=location, + subscription_id=self._config.subscription_id, + shape=shape, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.FlexComponent], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AutonomousDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`autonomous_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.AutonomousDatabase"]: + """List AutonomousDatabase resources by subscription ID. + + :return: An iterator like instance of AutonomousDatabase + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabase]] = 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_autonomous_databases_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDatabase], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + 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, + autonomousdatabasename: str, + resource: Union[_models.AutonomousDatabase, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_create_or_update_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + resource: _models.AutonomousDatabase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Create a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabase + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Create a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Create a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + resource: Union[_models.AutonomousDatabase, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Create a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param resource: Resource create parameters. Is one of the following types: AutonomousDatabase, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabase or JSON or IO[bytes] + :return: An instance of LROPoller that returns AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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, + autonomousdatabasename=autonomousdatabasename, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any) -> _models.AutonomousDatabase: + """Get a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :return: AutonomousDatabase. The AutonomousDatabase is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabase + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) + + _request = build_autonomous_databases_get_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial(self, resource_group_name: str, autonomousdatabasename: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_autonomous_databases_delete_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any) -> LROPoller[None]: + """Delete a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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, + autonomousdatabasename=autonomousdatabasename, + 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 + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: Union[_models.AutonomousDatabaseUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_update_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: _models.AutonomousDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Update a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdate + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Update a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Update a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + properties: Union[_models.AutonomousDatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Update a AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param properties: The resource properties to be updated. Is one of the following types: + AutonomousDatabaseUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdate or JSON or + IO[bytes] + :return: An instance of LROPoller that returns AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.AutonomousDatabase"]: + """List AutonomousDatabase resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of AutonomousDatabase + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabase]] = 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_autonomous_databases_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDatabase], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _switchover_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.PeerDbDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_switchover_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_switchover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.PeerDbDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform switchover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_switchover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform switchover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_switchover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform switchover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_switchover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.PeerDbDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform switchover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: PeerDbDetails, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails or JSON or IO[bytes] + :return: An instance of LROPoller that returns AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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._switchover_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _failover_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.PeerDbDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_failover_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_failover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.PeerDbDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform failover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_failover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform failover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_failover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform failover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_failover( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.PeerDbDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform failover action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: PeerDbDetails, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.PeerDbDetails or JSON or IO[bytes] + :return: An instance of LROPoller that returns AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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._failover_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def generate_wallet( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.GenerateAutonomousDatabaseWalletDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AutonomousDatabaseWalletFile: + """Generate wallet action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.GenerateAutonomousDatabaseWalletDetails + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AutonomousDatabaseWalletFile. The AutonomousDatabaseWalletFile is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def generate_wallet( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AutonomousDatabaseWalletFile: + """Generate wallet action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: AutonomousDatabaseWalletFile. The AutonomousDatabaseWalletFile is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def generate_wallet( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AutonomousDatabaseWalletFile: + """Generate wallet action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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: AutonomousDatabaseWalletFile. The AutonomousDatabaseWalletFile is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def generate_wallet( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.GenerateAutonomousDatabaseWalletDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.AutonomousDatabaseWalletFile: + """Generate wallet action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: + GenerateAutonomousDatabaseWalletDetails, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.GenerateAutonomousDatabaseWalletDetails or JSON + or IO[bytes] + :return: AutonomousDatabaseWalletFile. The AutonomousDatabaseWalletFile is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile + :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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabaseWalletFile] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_generate_wallet_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabaseWalletFile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _restore_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.RestoreAutonomousDatabaseDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_restore_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_restore( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.RestoreAutonomousDatabaseDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Restores an Autonomous Database based on the provided request parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.RestoreAutonomousDatabaseDetails + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_restore( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Restores an Autonomous Database based on the provided request parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_restore( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Restores an Autonomous Database based on the provided request parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_restore( + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.RestoreAutonomousDatabaseDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Restores an Autonomous Database based on the provided request parameters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: + RestoreAutonomousDatabaseDetails, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.RestoreAutonomousDatabaseDetails or JSON or + IO[bytes] + :return: An instance of LROPoller that returns AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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._restore_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _shrink_initial(self, resource_group_name: str, autonomousdatabasename: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_autonomous_databases_shrink_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_shrink( + self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """This operation shrinks the current allocated storage down to the current actual used data + storage. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :return: An instance of LROPoller that returns AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabase] = 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._shrink_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-10-01-preview", + params_added_on={ + "2024-10-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "autonomousdatabasename", + "content_type", + "accept", + ] + }, + ) + def _change_disaster_recovery_configuration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.DisasterRecoveryConfigurationDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_databases_change_disaster_recovery_configuration_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.DisasterRecoveryConfigurationDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: JSON + :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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: 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 AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-10-01-preview", + params_added_on={ + "2024-10-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "autonomousdatabasename", + "content_type", + "accept", + ] + }, + ) + def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.DisasterRecoveryConfigurationDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is one of the following types: + DisasterRecoveryConfigurationDetails, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails or JSON or + IO[bytes] + :return: An instance of LROPoller that returns AutonomousDatabase. The AutonomousDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabase] = 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._change_disaster_recovery_configuration_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.AutonomousDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class AutonomousDatabaseBackupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`autonomous_database_backups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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") + + def _create_or_update_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: Union[_models.AutonomousDatabaseBackup, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_database_backups_create_or_update_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: _models.AutonomousDatabaseBackup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabaseBackup]: + """Create a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup + :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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabaseBackup]: + """Create a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabaseBackup]: + """Create a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + resource: Union[_models.AutonomousDatabaseBackup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabaseBackup]: + """Create a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param resource: Resource create parameters. Is one of the following types: + AutonomousDatabaseBackup, JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup or JSON or IO[bytes] + :return: An instance of LROPoller that returns AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabaseBackup] = 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, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AutonomousDatabaseBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabaseBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabaseBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any + ) -> _models.AutonomousDatabaseBackup: + """Get a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :return: AutonomousDatabaseBackup. The AutonomousDatabaseBackup is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) + + _request = build_autonomous_database_backups_get_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabaseBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: 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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_autonomous_database_backups_delete_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + 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 + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: Union[_models.AutonomousDatabaseBackupUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_autonomous_database_backups_update_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: _models.AutonomousDatabaseBackupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabaseBackup]: + """Update a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdate + :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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabaseBackup]: + """Update a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabaseBackup]: + """Update a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + autonomousdatabasename: str, + adbbackupid: str, + properties: Union[_models.AutonomousDatabaseBackupUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabaseBackup]: + """Update a AutonomousDatabaseBackup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param adbbackupid: AutonomousDatabaseBackup id. Required. + :type adbbackupid: str + :param properties: The resource properties to be updated. Is one of the following types: + AutonomousDatabaseBackupUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdate or JSON or + IO[bytes] + :return: An instance of LROPoller that returns AutonomousDatabaseBackup. The + AutonomousDatabaseBackup is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutonomousDatabaseBackup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + adbbackupid=adbbackupid, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AutonomousDatabaseBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabaseBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabaseBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_parent( + self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any + ) -> ItemPaged["_models.AutonomousDatabaseBackup"]: + """List AutonomousDatabaseBackup resources by AutonomousDatabase. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :return: An iterator like instance of AutonomousDatabaseBackup + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabaseBackup]] = 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_autonomous_database_backups_list_by_parent_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDatabaseBackup], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AutonomousDatabaseCharacterSetsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`autonomous_database_character_sets` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, adbscharsetname: str, **kwargs: Any) -> _models.AutonomousDatabaseCharacterSet: + """Get a AutonomousDatabaseCharacterSet. + + :param location: The name of the Azure region. Required. + :type location: str + :param adbscharsetname: AutonomousDatabaseCharacterSet name. Required. + :type adbscharsetname: str + :return: AutonomousDatabaseCharacterSet. The AutonomousDatabaseCharacterSet is compatible with + MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabaseCharacterSet] = kwargs.pop("cls", None) + + _request = build_autonomous_database_character_sets_get_request( + location=location, + adbscharsetname=adbscharsetname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabaseCharacterSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location: str, **kwargs: Any) -> ItemPaged["_models.AutonomousDatabaseCharacterSet"]: + """List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of AutonomousDatabaseCharacterSet + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabaseCharacterSet]] = 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_autonomous_database_character_sets_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDatabaseCharacterSet], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AutonomousDatabaseNationalCharacterSetsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`autonomous_database_national_character_sets` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, location: str, adbsncharsetname: str, **kwargs: Any + ) -> _models.AutonomousDatabaseNationalCharacterSet: + """Get a AutonomousDatabaseNationalCharacterSet. + + :param location: The name of the Azure region. Required. + :type location: str + :param adbsncharsetname: AutonomousDatabaseNationalCharacterSets name. Required. + :type adbsncharsetname: str + :return: AutonomousDatabaseNationalCharacterSet. The AutonomousDatabaseNationalCharacterSet is + compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDatabaseNationalCharacterSet] = kwargs.pop("cls", None) + + _request = build_autonomous_database_national_character_sets_get_request( + location=location, + adbsncharsetname=adbsncharsetname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDatabaseNationalCharacterSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location( + self, location: str, **kwargs: Any + ) -> ItemPaged["_models.AutonomousDatabaseNationalCharacterSet"]: + """List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of AutonomousDatabaseNationalCharacterSet + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDatabaseNationalCharacterSet]] = 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_autonomous_database_national_character_sets_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AutonomousDatabaseNationalCharacterSet], deserialized.get("value", []) + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AutonomousDatabaseVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`autonomous_database_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, autonomousdbversionsname: str, **kwargs: Any) -> _models.AutonomousDbVersion: + """Get a AutonomousDbVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param autonomousdbversionsname: AutonomousDbVersion name. Required. + :type autonomousdbversionsname: str + :return: AutonomousDbVersion. The AutonomousDbVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDbVersion + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AutonomousDbVersion] = kwargs.pop("cls", None) + + _request = build_autonomous_database_versions_get_request( + location=location, + autonomousdbversionsname=autonomousdbversionsname, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.AutonomousDbVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location: str, **kwargs: Any) -> ItemPaged["_models.AutonomousDbVersion"]: + """List AutonomousDbVersion resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of AutonomousDbVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AutonomousDbVersion]] = 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_autonomous_database_versions_list_by_location_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.AutonomousDbVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExadbVmClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`exadb_vm_clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "accept"]}, + ) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.ExadbVmCluster"]: + """List ExadbVmCluster resources by subscription ID. + + :return: An iterator like instance of ExadbVmCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExadbVmCluster]] = 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_exadb_vm_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExadbVmCluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + def _create_or_update_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: Union[_models.ExadbVmCluster, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exadb_vm_clusters_create_or_update_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: _models.ExadbVmCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExadbVmCluster + :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 ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: Union[_models.ExadbVmCluster, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Is one of the following types: ExadbVmCluster, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExadbVmCluster or JSON or IO[bytes] + :return: An instance of LROPoller that returns ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExadbVmCluster] = 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, + exadb_vm_cluster_name=exadb_vm_cluster_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExadbVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "accept", + ] + }, + ) + def get(self, resource_group_name: str, exadb_vm_cluster_name: str, **kwargs: Any) -> _models.ExadbVmCluster: + """Get a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: ExadbVmCluster. The ExadbVmCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.ExadbVmCluster + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExadbVmCluster] = kwargs.pop("cls", None) + + _request = build_exadb_vm_clusters_get_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.ExadbVmCluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + def _update_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: Union[_models.ExadbVmClusterUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exadb_vm_clusters_update_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: _models.ExadbVmClusterUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdate + :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 ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: Union[_models.ExadbVmClusterUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Is one of the following types: + ExadbVmClusterUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExadbVmCluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExadbVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "accept", + ] + }, + ) + def _delete_initial(self, resource_group_name: str, exadb_vm_cluster_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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_exadb_vm_clusters_delete_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "accept", + ] + }, + ) + def begin_delete(self, resource_group_name: str, exadb_vm_cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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, + exadb_vm_cluster_name=exadb_vm_cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + 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 + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + ) + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.ExadbVmCluster"]: + """List ExadbVmCluster resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ExadbVmCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExadbVmCluster]] = 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_exadb_vm_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExadbVmCluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + def _remove_vms_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: Union[_models.RemoveVirtualMachineFromExadbVmClusterDetails, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exadb_vm_clusters_remove_vms_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: _models.RemoveVirtualMachineFromExadbVmClusterDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.RemoveVirtualMachineFromExadbVmClusterDetails + :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 ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: JSON + :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 ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: 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 ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "content_type", + "accept", + ] + }, + ) + def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: Union[_models.RemoveVirtualMachineFromExadbVmClusterDetails, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Is one of the following types: + RemoveVirtualMachineFromExadbVmClusterDetails, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.RemoveVirtualMachineFromExadbVmClusterDetails or + JSON or IO[bytes] + :return: An instance of LROPoller that returns ExadbVmCluster. The ExadbVmCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExadbVmCluster] = 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._remove_vms_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ExadbVmCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExascaleDbNodesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`exascale_db_nodes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "exascale_db_node_name", + "accept", + ] + }, + ) + def get( + self, resource_group_name: str, exadb_vm_cluster_name: str, exascale_db_node_name: str, **kwargs: Any + ) -> _models.ExascaleDbNode: + """Get a ExascaleDbNode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :return: ExascaleDbNode. The ExascaleDbNode is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.ExascaleDbNode + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExascaleDbNode] = kwargs.pop("cls", None) + + _request = build_exascale_db_nodes_get_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.ExascaleDbNode, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "accept", + ] + }, + ) + def list_by_parent( + self, resource_group_name: str, exadb_vm_cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.ExascaleDbNode"]: + """List ExascaleDbNode resources by ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: An iterator like instance of ExascaleDbNode + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbNode] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExascaleDbNode]] = 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_exascale_db_nodes_list_by_parent_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExascaleDbNode], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "exascale_db_node_name", + "content_type", + "accept", + ] + }, + ) + def _action_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: Union[_models.DbNodeAction, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exascale_db_nodes_action_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: _models.DbNodeAction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction + :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 DbActionResponse. The DbActionResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: JSON + :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 DbActionResponse. The DbActionResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: 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 DbActionResponse. The DbActionResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exadb_vm_cluster_name", + "exascale_db_node_name", + "content_type", + "accept", + ] + }, + ) + def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: Union[_models.DbNodeAction, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Is one of the following types: DbNodeAction, + JSON, IO[bytes] Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction or JSON or IO[bytes] + :return: An instance of LROPoller that returns DbActionResponse. The DbActionResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DbActionResponse] = 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._action_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_name, + body=body, + 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): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DbActionResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DbActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DbActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExascaleDbStorageVaultsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`exascale_db_storage_vaults` attribute. """ - models = _models - - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: - """List the operations for the provider. + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "accept", + ] + }, + ) + def get( + self, resource_group_name: str, exascale_db_storage_vault_name: str, **kwargs: Any + ) -> _models.ExascaleDbStorageVault: + """Get a ExascaleDbStorageVault. - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.Operation] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :return: ExascaleDbStorageVault. The ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault + :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 = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExascaleDbStorageVault] = kwargs.pop("cls", None) + + _request = build_exascale_db_storage_vaults_get_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.ExascaleDbStorageVault, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "content_type", + "accept", + ] + }, + ) + def _create_initial( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: Union[_models.ExascaleDbStorageVault, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exascale_db_storage_vaults_create_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: _models.ExascaleDbStorageVault, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault + :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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "content_type", + "accept", + ] + }, + ) + def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: Union[_models.ExascaleDbStorageVault, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Is one of the following types: + ExascaleDbStorageVault, JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault or JSON or IO[bytes] + :return: An instance of LROPoller that returns ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExascaleDbStorageVault] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExascaleDbStorageVault, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExascaleDbStorageVault].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExascaleDbStorageVault]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "content_type", + "accept", + ] + }, + ) + def _update_initial( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: Union[_models.ExascaleDbStorageVaultTagsUpdate, JSON, 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 = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_exascale_db_storage_vaults_update_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: _models.ExascaleDbStorageVaultTagsUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultTagsUpdate + :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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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 ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "content_type", + "accept", + ] + }, + ) + def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: Union[_models.ExascaleDbStorageVaultTagsUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Is one of the following types: + ExascaleDbStorageVaultTagsUpdate, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultTagsUpdate or JSON or + IO[bytes] + :return: An instance of LROPoller that returns ExascaleDbStorageVault. The + ExascaleDbStorageVault is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExascaleDbStorageVault] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + properties=properties, + 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): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ExascaleDbStorageVault, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExascaleDbStorageVault].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExascaleDbStorageVault]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "accept", + ] + }, + ) + def _delete_initial( + self, resource_group_name: str, exascale_db_storage_vault_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 = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_exascale_db_storage_vaults_delete_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={ + "2024-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "exascale_db_storage_vault_name", + "accept", + ] + }, + ) + def begin_delete( + self, resource_group_name: str, exascale_db_storage_vault_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + 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 + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + ) + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.ExascaleDbStorageVault"]: + """List ExascaleDbStorageVault resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ExascaleDbStorageVault + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExascaleDbStorageVault]] = 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_exascale_db_storage_vaults_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExascaleDbStorageVault], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2024-12-01-preview", + params_added_on={"2024-12-01-preview": ["api_version", "subscription_id", "accept"]}, + ) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.ExascaleDbStorageVault"]: + """List ExascaleDbStorageVault resources by subscription ID. + + :return: An iterator like instance of ExascaleDbStorageVault + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ExascaleDbStorageVault]] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -104,13 +14712,18 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_exascale_db_storage_vaults_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -125,17 +14738,21 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ExascaleDbStorageVault], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -148,7 +14765,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_oracle_subscriptions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_oracle_subscriptions_operations.py deleted file mode 100644 index 8a2abea9eebb..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_oracle_subscriptions_operations.py +++ /dev/null @@ -1,1106 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions") - 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_get_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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" - ) # pylint: disable=line-too-long - 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_create_or_update_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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" - ) # pylint: disable=line-too-long - 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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" - ) # pylint: disable=line-too-long - 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" - ) # pylint: disable=line-too-long - 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_activation_links_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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listActivationLinks", - ) # pylint: disable=line-too-long - 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="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_cloud_account_details_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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listCloudAccountDetails", - ) # pylint: disable=line-too-long - 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="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_saas_subscription_details_request( # pylint: disable=name-too-long - 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listSaasSubscriptionDetails", - ) # pylint: disable=line-too-long - 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="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class OracleSubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`oracle_subscriptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.OracleSubscription"]: - """List OracleSubscription resources by subscription ID. - - :return: An iterator like instance of either OracleSubscription or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OracleSubscriptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OracleSubscriptionListResult", 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(self, **kwargs: Any) -> _models.OracleSubscription: - """Get a OracleSubscription. - - :return: OracleSubscription or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.OracleSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) - - _request = build_get_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("OracleSubscription", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, resource: Union[_models.OracleSubscription, IO[bytes]], **kwargs: Any - ) -> _models.OracleSubscription: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "OracleSubscription") - - _request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("OracleSubscription", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("OracleSubscription", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, resource: _models.OracleSubscription, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OracleSubscription]: - """Create a OracleSubscription. - - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.OracleSubscription - :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 OracleSubscription or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OracleSubscription]: - """Create a OracleSubscription. - - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either OracleSubscription or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, resource: Union[_models.OracleSubscription, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.OracleSubscription]: - """Create a OracleSubscription. - - :param resource: Resource create parameters. Is either a OracleSubscription type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.OracleSubscription or IO[bytes] - :return: An instance of LROPoller that returns either OracleSubscription or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OracleSubscription] = 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=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OracleSubscription", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.OracleSubscription].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OracleSubscription]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, properties: Union[_models.OracleSubscriptionUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.OracleSubscription]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.OracleSubscription]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _json = self._serialize.body(properties, "OracleSubscriptionUpdate") - - _request = build_update_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("OracleSubscription", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, properties: _models.OracleSubscriptionUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OracleSubscription]: - """Update a OracleSubscription. - - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdate - :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 OracleSubscription or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OracleSubscription]: - """Update a OracleSubscription. - - :param properties: The resource properties to be updated. Required. - :type properties: 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 OracleSubscription or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, properties: Union[_models.OracleSubscriptionUpdate, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.OracleSubscription]: - """Update a OracleSubscription. - - :param properties: The resource properties to be updated. Is either a OracleSubscriptionUpdate - type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdate or IO[bytes] - :return: An instance of LROPoller that returns either OracleSubscription or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.OracleSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OracleSubscription] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - properties=properties, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OracleSubscription", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.OracleSubscription].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OracleSubscription]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete(self, **kwargs: Any) -> LROPoller[None]: - """Delete a OracleSubscription. - - :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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_models.ActivationLinks]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.ActivationLinks]] = kwargs.pop("cls", None) - - _request = build_list_activation_links_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ActivationLinks", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_list_activation_links(self, **kwargs: Any) -> LROPoller[_models.ActivationLinks]: - """List Activation Links. - - :return: An instance of LROPoller that returns either ActivationLinks or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ActivationLinks] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ActivationLinks] = 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._list_activation_links_initial( - api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ActivationLinks", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ActivationLinks].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ActivationLinks]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_models.CloudAccountDetails]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.CloudAccountDetails]] = kwargs.pop("cls", None) - - _request = build_list_cloud_account_details_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudAccountDetails", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_list_cloud_account_details(self, **kwargs: Any) -> LROPoller[_models.CloudAccountDetails]: - """List Cloud Account Details. - - :return: An instance of LROPoller that returns either CloudAccountDetails or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.CloudAccountDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CloudAccountDetails] = 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._list_cloud_account_details_initial( - api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CloudAccountDetails", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CloudAccountDetails].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CloudAccountDetails]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Optional[_models.SaasSubscriptionDetails]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.SaasSubscriptionDetails]] = kwargs.pop("cls", None) - - _request = build_list_saas_subscription_details_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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, 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 - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_list_saas_subscription_details(self, **kwargs: Any) -> LROPoller[_models.SaasSubscriptionDetails]: - """List Saas Subscription Details. - - :return: An instance of LROPoller that returns either SaasSubscriptionDetails or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.SaasSubscriptionDetails] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SaasSubscriptionDetails] = 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._list_saas_subscription_details_initial( - api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SaasSubscriptionDetails].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SaasSubscriptionDetails]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_patch.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_patch.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/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/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_system_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_system_versions_operations.py deleted file mode 100644 index 1b3427533c4f..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_system_versions_operations.py +++ /dev/null @@ -1,253 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions" - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location: str, systemversionname: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "systemversionname": _SERIALIZER.url("systemversionname", systemversionname, "str", pattern=r".*"), - } - - _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 SystemVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`system_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.SystemVersion"]: - """List SystemVersion resources by Location. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either SystemVersion or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.SystemVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SystemVersionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SystemVersionListResult", 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(self, location: str, systemversionname: str, **kwargs: Any) -> _models.SystemVersion: - """Get a SystemVersion. - - :param location: The name of the Azure region. Required. - :type location: str - :param systemversionname: SystemVersion name. Required. - :type systemversionname: str - :return: SystemVersion or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.SystemVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SystemVersion] = kwargs.pop("cls", None) - - _request = build_get_request( - location=location, - systemversionname=systemversionname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("SystemVersion", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_virtual_network_addresses_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_virtual_network_addresses_operations.py deleted file mode 100644 index 9aab31be0eb0..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_virtual_network_addresses_operations.py +++ /dev/null @@ -1,686 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_cloud_vm_cluster_request( - resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - cloudvmclustername: str, - virtualnetworkaddressname: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - "virtualnetworkaddressname": _SERIALIZER.url( - "virtualnetworkaddressname", virtualnetworkaddressname, "str", max_length=63, min_length=1, pattern=r".*" - ), - } - - _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, - cloudvmclustername: str, - virtualnetworkaddressname: 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", "2023-09-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - "virtualnetworkaddressname": _SERIALIZER.url( - "virtualnetworkaddressname", virtualnetworkaddressname, "str", max_length=63, min_length=1, pattern=r".*" - ), - } - - _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, - cloudvmclustername: str, - virtualnetworkaddressname: 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", "2023-09-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "cloudvmclustername": _SERIALIZER.url("cloudvmclustername", cloudvmclustername, "str", pattern=r".*"), - "virtualnetworkaddressname": _SERIALIZER.url( - "virtualnetworkaddressname", virtualnetworkaddressname, "str", max_length=63, min_length=1, pattern=r".*" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class VirtualNetworkAddressesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s - :attr:`virtual_network_addresses` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cloud_vm_cluster( - self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any - ) -> Iterable["_models.VirtualNetworkAddress"]: - """List VirtualNetworkAddress resources by CloudVmCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :return: An iterator like instance of either VirtualNetworkAddress or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualNetworkAddressListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_cloud_vm_cluster_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualNetworkAddressListResult", 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( - self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any - ) -> _models.VirtualNetworkAddress: - """Get a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: str - :return: VirtualNetworkAddress or the result of cls(response) - :rtype: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualNetworkAddress] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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("VirtualNetworkAddress", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - cloudvmclustername: str, - virtualnetworkaddressname: str, - resource: Union[_models.VirtualNetworkAddress, IO[bytes]], - **kwargs: Any - ) -> _models.VirtualNetworkAddress: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualNetworkAddress] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "VirtualNetworkAddress") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) - - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - virtualnetworkaddressname: str, - resource: _models.VirtualNetworkAddress, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VirtualNetworkAddress]: - """Create a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress - :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 VirtualNetworkAddress or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - virtualnetworkaddressname: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VirtualNetworkAddress]: - """Create a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either VirtualNetworkAddress or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - cloudvmclustername: str, - virtualnetworkaddressname: str, - resource: Union[_models.VirtualNetworkAddress, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.VirtualNetworkAddress]: - """Create a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: str - :param resource: Resource create parameters. Is either a VirtualNetworkAddress type or a - IO[bytes] type. Required. - :type resource: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress or IO[bytes] - :return: An instance of LROPoller that returns either VirtualNetworkAddress or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.VirtualNetworkAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualNetworkAddress] = 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, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - resource=resource, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.VirtualNetworkAddress].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.VirtualNetworkAddress]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _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 [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a VirtualNetworkAddress. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cloudvmclustername: CloudVmCluster name. Required. - :type cloudvmclustername: str - :param virtualnetworkaddressname: Virtual IP address hostname. Required. - :type virtualnetworkaddressname: 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._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - cloudvmclustername=cloudvmclustername, - virtualnetworkaddressname=virtualnetworkaddressname, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_create.py deleted file mode 100644 index 770123e172d9..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_create.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_backup_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_database_backups.begin_create_or_update( - resource_group_name="rg000", - autonomousdatabasename="databasedb1", - adbbackupid="1711644130", - resource={ - "properties": { - "autonomousDatabaseOcid": "ocid1.autonomousdatabase.oc1..aaaaa3klq", - "displayName": "Nightly Backup", - "retentionPeriodInDays": 365, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_create.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_delete.py deleted file mode 100644 index 6a9d9d6ed170..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_backup_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.autonomous_database_backups.begin_delete( - resource_group_name="rg000", - autonomousdatabasename="databasedb1", - adbbackupid="1711644130", - ).result() - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_delete.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_get.py deleted file mode 100644 index 95a871ec18c4..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_backup_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_database_backups.get( - resource_group_name="rg000", - autonomousdatabasename="databasedb1", - adbbackupid="1711644130", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_list_by_parent.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_list_by_parent.py deleted file mode 100644 index c44123a23a2d..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_list_by_parent.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_backup_list_by_parent.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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_database_backups.list_by_autonomous_database( - resource_group_name="rg000", - autonomousdatabasename="databasedb1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_listByParent.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_shrink.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_change_disaster_recovery_configuration.py similarity index 74% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_shrink.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_change_disaster_recovery_configuration.py index e6719a3457d7..7918b76fc230 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_shrink.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_change_disaster_recovery_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python autonomous_database_shrink.py + python autonomous_database_change_disaster_recovery_configuration.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, @@ -27,16 +27,17 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.autonomous_databases.begin_shrink( + response = client.autonomous_databases.begin_change_disaster_recovery_configuration( resource_group_name="rg000", autonomousdatabasename="databasedb1", + body={"disasterRecoveryType": "Adg", "isReplicateAutomaticBackups": False}, ).result() print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_shrink.json +# x-ms-original-file: 2025-03-01/autonomousDatabase_changeDisasterRecoveryConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_list_by_location.py deleted file mode 100644 index 26a2ec573283..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_list_by_location.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_character_set_list_by_location.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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_database_character_sets.list_by_location( - location="eastus", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_listByLocation.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_clone_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_clone_create.py deleted file mode 100644 index 43579c3de1d1..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_clone_create.py +++ /dev/null @@ -1,62 +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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_clone_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_databases.begin_create_or_update( - resource_group_name="rg000", - autonomousdatabasename="databasedb1", - resource={ - "location": "eastus", - "properties": { - "adminPassword": "********", - "characterSet": "AL32UTF8", - "cloneType": "Full", - "computeCount": 2, - "computeModel": "ECPU", - "dataBaseType": "Clone", - "dataStorageSizeInTbs": 1, - "displayName": "example_autonomous_databasedb1_clone", - "ncharacterSet": "AL16UTF16", - "sourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1", - "subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", - "vnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1", - }, - "tags": {"tagK1": "tagV1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseClone_create.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_create.py deleted file mode 100644 index 644752cab908..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_create.py +++ /dev/null @@ -1,61 +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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_databases.begin_create_or_update( - resource_group_name="rg000", - autonomousdatabasename="databasedb1", - resource={ - "location": "eastus", - "properties": { - "adminPassword": "********", - "characterSet": "AL32UTF8", - "computeCount": 2, - "computeModel": "ECPU", - "dataBaseType": "Regular", - "dataStorageSizeInTbs": 1, - "dbVersion": "18.4.0.0", - "displayName": "example_autonomous_databasedb1", - "ncharacterSet": "AL16UTF16", - "subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", - "vnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1", - }, - "tags": {"tagK1": "tagV1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_create.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_delete.py deleted file mode 100644 index 38e1c3aa88dc..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.autonomous_databases.begin_delete( - resource_group_name="rg000", - autonomousdatabasename="databasedb1", - ).result() - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_delete.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_failover.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_failover.py index 0321ffd38310..0118bf3361f6 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_failover.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_failover.py @@ -2,12 +2,10 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -29,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.autonomous_databases.begin_failover( @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_failover.json +# x-ms-original-file: 2025-03-01/autonomousDatabase_failover.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_generate_wallet.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_generate_wallet.py index 9262776dc471..658d62ff2f30 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_generate_wallet.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_generate_wallet.py @@ -2,12 +2,10 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -29,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.autonomous_databases.generate_wallet( @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_generateWallet.json +# x-ms-original-file: 2025-03-01/autonomousDatabase_generateWallet.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_resource_group.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_resource_group.py index f82aecc817a2..6393f948331a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_resource_group.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_resource_group.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.autonomous_databases.list_by_resource_group( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listByResourceGroup.json +# x-ms-original-file: 2025-03-01/autonomousDatabase_listByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_subscription.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_subscription.py deleted file mode 100644 index 76ad78db200a..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_subscription.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_databases.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_get.py deleted file mode 100644 index 8b7d0994d9e2..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_national_character_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_database_national_character_sets.get( - location="eastus", - adbsncharsetname="NATIONAL", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_list_by_location.py deleted file mode 100644 index 009c4680c32b..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_list_by_location.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_national_character_set_list_by_location.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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_database_national_character_sets.list_by_location( - location="eastus", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_listByLocation.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_restore.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_restore.py index c532ead6a15d..c0db21c09f60 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_restore.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_restore.py @@ -2,12 +2,10 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -29,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.autonomous_databases.begin_restore( @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_restore.json +# x-ms-original-file: 2025-03-01/autonomousDatabase_restore.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_switchover.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_switchover.py index 77ad07d654c8..2e26f3a3e983 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_switchover.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_switchover.py @@ -2,12 +2,10 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -29,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.autonomous_databases.begin_switchover( @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_switchover.json +# x-ms-original-file: 2025-03-01/autonomousDatabase_switchover.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_get.py deleted file mode 100644 index 206b107456e0..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_version_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_database_versions.get( - location="eastus", - autonomousdbversionsname="18.4.0.0", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_list_by_location.py deleted file mode 100644 index 9adf403086cd..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_list_by_location.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python autonomous_database_version_list_by_location.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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.autonomous_database_versions.list_by_location( - location="eastus", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_listByLocation.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_action.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_action.py index cdaefa34f7b2..a85ba88fd26a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_action.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_action.py @@ -2,12 +2,10 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -29,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.db_nodes.begin_action( @@ -41,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_action.json +# x-ms-original-file: 2025-03-01/dbNodes_action.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_get.py deleted file mode 100644 index 19e91f87840e..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python db_nodes_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.db_nodes.get( - resource_group_name="rg000", - cloudvmclustername="cluster1", - dbnodeocid="ocid1....aaaaaa", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_list_by_parent.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_list_by_parent.py deleted file mode 100644 index 46c1c2819691..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_list_by_parent.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python db_nodes_list_by_parent.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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.db_nodes.list_by_cloud_vm_cluster( - resource_group_name="rg000", - cloudvmclustername="cluster1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_listByParent.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_get.py deleted file mode 100644 index 7ef792665291..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python db_servers_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.db_servers.get( - resource_group_name="rg000", - cloudexadatainfrastructurename="infra1", - dbserverocid="ocid1....aaaaaa", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_list_by_parent.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_list_by_parent.py deleted file mode 100644 index a9fe9312f4e0..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_list_by_parent.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python db_servers_list_by_parent.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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.db_servers.list_by_cloud_exadata_infrastructure( - resource_group_name="rg000", - cloudexadatainfrastructurename="infra1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_listByParent.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_get.py deleted file mode 100644 index 61b558fef64b..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python db_system_shapes_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.db_system_shapes.get( - location="eastus", - dbsystemshapename="EXADATA.X9M", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_list_by_location.py index 9f86ad401e86..9c9fbfba72d0 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_list_by_location.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.db_system_shapes.list_by_location( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_listByLocation.json +# x-ms-original-file: 2025-03-01/dbSystemShapes_listByLocation.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_get.py deleted file mode 100644 index 0b0c969b3e0e..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python dns_private_views_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.dns_private_views.get( - location="eastus", - dnsprivateviewocid="ocid1....aaaaaa", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_get.py deleted file mode 100644 index 8f92c292c7b1..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python dns_private_zones_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.dns_private_zones.get( - location="eastus", - dnsprivatezonename="example-dns-private-zone", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_add_storage_capacity.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_add_storage_capacity.py index 2f87fb2a4eae..e5601e25234a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_add_storage_capacity.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_add_storage_capacity.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.cloud_exadata_infrastructures.begin_add_storage_capacity( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_addStorageCapacity.json +# x-ms-original-file: 2025-03-01/exaInfra_addStorageCapacity.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_create.py deleted file mode 100644 index 3c4f30b4d606..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_create.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 typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python exa_infra_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cloud_exadata_infrastructures.begin_create_or_update( - resource_group_name="rg000", - cloudexadatainfrastructurename="infra1", - resource={ - "location": "eastus", - "properties": {"computeCount": 100, "displayName": "infra 1", "shape": "EXADATA.X9M", "storageCount": 10}, - "tags": {"tagK1": "tagV1"}, - "zones": ["1"], - }, - ).result() - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_create.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_delete.py deleted file mode 100644 index 525bb2437b80..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python exa_infra_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.cloud_exadata_infrastructures.begin_delete( - resource_group_name="rg000", - cloudexadatainfrastructurename="infra1", - ).result() - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_delete.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_get.py deleted file mode 100644 index f55f5532bcba..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python exa_infra_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cloud_exadata_infrastructures.get( - resource_group_name="rg000", - cloudexadatainfrastructurename="infra1", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_resource_group.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_resource_group.py deleted file mode 100644 index 2eda62e4e2e2..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_resource_group.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python exa_infra_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cloud_exadata_infrastructures.list_by_resource_group( - resource_group_name="rg000", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_subscription.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_subscription.py deleted file mode 100644 index b2181c65efc8..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_subscription.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python exa_infra_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cloud_exadata_infrastructures.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_remove_vms_maximum_set_gen.py similarity index 62% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_create.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_remove_vms_maximum_set_gen.py index 86fefc017010..a0b7367f3d15 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_create.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_remove_vms_maximum_set_gen.py @@ -1,13 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -17,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python oracle_subscriptions_create.py + python exadb_vm_clusters_remove_vms_maximum_set_gen.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, @@ -29,24 +28,23 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.oracle_subscriptions.begin_create_or_update( - resource={ - "plan": { - "name": "plan1", - "product": "product1", - "promotionCode": "none", - "publisher": "publisher1", - "version": "alpha", - }, - "properties": {}, + response = client.exadb_vm_clusters.begin_remove_vms( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + body={ + "dbNodes": [ + { + "dbNodeId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Oracle.Database/exadbVmClusters/vmCluster/dbNodes/dbNodeName" + } + ] }, ).result() print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_create.json +# x-ms-original-file: 2025-03-01/ExadbVmClusters_RemoveVms_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_action_maximum_set_gen.py similarity index 71% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_get.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_action_maximum_set_gen.py index 807ca5436113..be01fe7a012d 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_action_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python autonomous_database_character_set_get.py + python exascale_db_nodes_action_maximum_set_gen.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, @@ -27,16 +27,18 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.autonomous_database_character_sets.get( - location="eastus", - adbscharsetname="DATABASE", - ) + response = client.exascale_db_nodes.begin_action( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + exascale_db_node_name="dbNodeName", + body={"action": "Start"}, + ).result() print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_get.json +# x-ms-original-file: 2025-03-01/ExascaleDbNodes_Action_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_list_by_parent_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_list_by_parent_maximum_set_gen.py new file mode 100644 index 000000000000..1fd6c00cf04f --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_list_by_parent_maximum_set_gen.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_nodes_list_by_parent_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.exascale_db_nodes.list_by_parent( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-03-01/ExascaleDbNodes_ListByParent_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_create_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_create_maximum_set_gen.py new file mode 100644 index 000000000000..646bfe84c342 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_create_maximum_set_gen.py @@ -0,0 +1,58 @@ +# 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) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_storage_vaults_create_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.exascale_db_storage_vaults.begin_create( + resource_group_name="rgopenapi", + exascale_db_storage_vault_name="vmClusterName", + resource={ + "location": "ltguhzffucaytqg", + "properties": { + "additionalFlashCacheInPercent": 0, + "description": "dmnvnnduldfmrmkkvvsdtuvmsmruxzzpsfdydgytlckutfozephjygjetrauvbdfcwmti", + "displayName": "hbsybtelyvhpalemszcvartlhwvskrnpiveqfblvkdihoytqaotdgsgauvgivzaftfgeiwlyeqzssicwrrnlxtsmeakbcsxabjlt", + "highCapacityDatabaseStorage": {"availableSizeInGbs": 28, "totalSizeInGbs": 16}, + "highCapacityDatabaseStorageInput": {"totalSizeInGbs": 21}, + "lifecycleState": "Provisioning", + "ocid": "ocid1.autonomousdatabase.oc1..aaaaa3klq", + "timeZone": "ltrbozwxjunncicrtzjrpqnqrcjgghohztrdlbfjrbkpenopyldwolslwgrgumjfkyovvkzcuxjujuxtjjzubvqvnhrswnbdgcbslopeofmtepbrrlymqwwszvsglmyuvlcuejshtpokirwklnwpcykhyinjmlqvxtyixlthtdishhmtipbygsayvgqzfrprgppylydlcskbmvwctxifdltippfvsxiughqbojqpqrekxsotnqsk", + }, + "tags": {"key7827": "xqi"}, + "zones": ["qk"], + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-03-01/ExascaleDbStorageVaults_Create_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_delete_maximum_set_gen.py similarity index 74% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_delete.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_delete_maximum_set_gen.py index f7221b825f9f..bc9e70cf1747 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_delete.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_delete_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python vm_clusters_delete.py + python exascale_db_storage_vaults_delete_maximum_set_gen.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, @@ -27,15 +27,15 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - client.cloud_vm_clusters.begin_delete( - resource_group_name="rg000", - cloudvmclustername="cluster1", + client.exascale_db_storage_vaults.begin_delete( + resource_group_name="rgopenapi", + exascale_db_storage_vault_name="vmClusterName", ).result() -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_delete.json +# x-ms-original-file: 2025-03-01/ExascaleDbStorageVaults_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_get_maximum_set_gen.py similarity index 74% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_get.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_get_maximum_set_gen.py index 6f140206350b..e6fa19609634 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_get_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python vm_clusters_get.py + python exascale_db_storage_vaults_get_maximum_set_gen.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, @@ -27,16 +27,16 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.cloud_vm_clusters.get( - resource_group_name="rg000", - cloudvmclustername="cluster1", + response = client.exascale_db_storage_vaults.get( + resource_group_name="rgopenapi", + exascale_db_storage_vault_name="vmClusterName", ) print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_get.json +# x-ms-original-file: 2025-03-01/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_resource_group_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_resource_group_maximum_set_gen.py new file mode 100644 index 000000000000..cff1e33cec13 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_resource_group_maximum_set_gen.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_storage_vaults_list_by_resource_group_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.exascale_db_storage_vaults.list_by_resource_group( + resource_group_name="rgopenapi", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-03-01/ExascaleDbStorageVaults_ListByResourceGroup_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_subscription.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_subscription_maximum_set_gen.py similarity index 76% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_subscription.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_subscription_maximum_set_gen.py index ecfb2edfc1b5..484a1b53eaef 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_subscription.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_subscription_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python vm_clusters_list_by_subscription.py + python exascale_db_storage_vaults_list_by_subscription_maximum_set_gen.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, @@ -27,14 +27,14 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.cloud_vm_clusters.list_by_subscription() + response = client.exascale_db_storage_vaults.list_by_subscription() for item in response: print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listBySubscription.json +# x-ms-original-file: 2025-03-01/ExascaleDbStorageVaults_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_update_maximum_set_gen.py similarity index 71% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_get.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_update_maximum_set_gen.py index 03fa0a44a22f..1a458dbef2af 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_update_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python autonomous_database_get.py + python exascale_db_storage_vaults_update_maximum_set_gen.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, @@ -27,16 +27,17 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.autonomous_databases.get( - resource_group_name="rg000", - autonomousdatabasename="databasedb1", - ) + response = client.exascale_db_storage_vaults.begin_update( + resource_group_name="rgopenapi", + exascale_db_storage_vault_name="vmClusterName", + properties={"tags": {"key6179": "ouj"}}, + ).result() print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json +# x-ms-original-file: 2025-03-01/ExascaleDbStorageVaults_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_get_maximum_set_gen.py similarity index 77% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_get_maximum_set_gen.py index 28235a48b7d5..9677afabef19 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_get_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python gi_versions_get.py + python flex_components_get_maximum_set_gen.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, @@ -27,16 +27,16 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.gi_versions.get( + response = client.flex_components.get( location="eastus", - giversionname="19.0.0.0", + flex_component_name="flexComponent", ) print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_get.json +# x-ms-original-file: 2025-03-01/FlexComponents_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_list_by_parent_maximum_set_gen.py similarity index 76% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_list_by_location.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_list_by_parent_maximum_set_gen.py index 4c0ca9005831..1cce6c659bde 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_list_by_parent_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python system_versions_list_by_location.py + python flex_components_list_by_parent_maximum_set_gen.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, @@ -27,16 +27,16 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.system_versions.list_by_location( + response = client.flex_components.list_by_parent( location="eastus", ) for item in response: print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_listByLocation.json +# x-ms-original-file: 2025-03-01/FlexComponents_ListByParent_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_get_maximum_set_gen.py similarity index 76% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_get.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_get_maximum_set_gen.py index 1110fde7f564..68ef22e3ed89 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_get_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python system_versions_get.py + python gi_minor_versions_get_maximum_set_gen.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, @@ -27,16 +27,17 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.system_versions.get( + response = client.gi_minor_versions.get( location="eastus", - systemversionname="22.x", + giversionname="giVersionName", + gi_minor_version_name="giMinorVersionName", ) print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json +# x-ms-original-file: 2025-03-01/GiMinorVersions_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_list_by_parent_maximum_set_gen.py similarity index 76% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_list_by_location.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_list_by_parent_maximum_set_gen.py index d8d53494bcb1..4434fd6279ae 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_list_by_parent_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python dns_private_zones_list_by_location.py + python gi_minor_versions_list_by_parent_maximum_set_gen.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, @@ -27,16 +27,17 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.dns_private_zones.list_by_location( + response = client.gi_minor_versions.list_by_parent( location="eastus", + giversionname="giVersionName", ) for item in response: print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_listByLocation.json +# x-ms-original-file: 2025-03-01/GiMinorVersions_ListByParent_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_maximum_set_gen.py similarity index 80% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_maximum_set_gen.py index 750275cec17d..def8e766ee80 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_maximum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python gi_versions_list_by_location.py + python gi_versions_list_by_location_maximum_set_gen.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, @@ -27,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.gi_versions.list_by_location( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_listByLocation.json +# x-ms-original-file: 2025-03-01/GiVersions_ListByLocation_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_minimum_set_gen.py similarity index 76% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_list_by_location.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_minimum_set_gen.py index 0629a4b703ae..a58986423d88 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_minimum_set_gen.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python dns_private_views_list_by_location.py + python gi_versions_list_by_location_minimum_set_gen.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, @@ -27,16 +27,16 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.dns_private_views.list_by_location( + response = client.gi_versions.list_by_location( location="eastus", ) for item in response: print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_listByLocation.json +# x-ms-original-file: 2025-03-01/GiVersions_ListByLocation_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/operations_list.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/operations_list.py index 6180090ba956..f1ede5df46ec 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/operations_list.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/operations_list.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/operations_list.json +# x-ms-original-file: 2025-03-01/operations_list.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_add_azure_subscriptions.py similarity index 74% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_delete.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_add_azure_subscriptions.py index cc22d43c96f6..16b78317f862 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_delete.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_add_azure_subscriptions.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python oracle_subscriptions_delete.py + python oracle_subscriptions_add_azure_subscriptions.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, @@ -27,12 +27,14 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - client.oracle_subscriptions.begin_delete().result() + client.oracle_subscriptions.begin_add_azure_subscriptions( + body={"azureSubscriptionIds": ["00000000-0000-0000-0000-000000000001"]}, + ).result() -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_delete.json +# x-ms-original-file: 2025-03-01/oracleSubscriptions_addAzureSubscriptions.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_get.py deleted file mode 100644 index d4cecbdb1dea..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_get.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python oracle_subscriptions_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.oracle_subscriptions.get() - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_activation_links.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_activation_links.py index 828f5267dc44..dfd2b07c07d4 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_activation_links.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_activation_links.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,13 +27,13 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.oracle_subscriptions.begin_list_activation_links().result() print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listActivationLinks.json +# x-ms-original-file: 2025-03-01/oracleSubscriptions_listActivationLinks.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_by_subscription.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_by_subscription.py deleted file mode 100644 index f17abbdcad3c..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_by_subscription.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python oracle_subscriptions_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.oracle_subscriptions.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_cloud_account_details.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_cloud_account_details.py index 63e70fbd2014..5d8fbc1d725d 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_cloud_account_details.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_cloud_account_details.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,13 +27,13 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.oracle_subscriptions.begin_list_cloud_account_details().result() print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listCloudAccountDetails.json +# x-ms-original-file: 2025-03-01/oracleSubscriptions_listCloudAccountDetails.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_saas_subscription_details.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_saas_subscription_details.py index 93c9be83c55f..865c13d45669 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_saas_subscription_details.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_saas_subscription_details.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,13 +27,13 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.oracle_subscriptions.begin_list_saas_subscription_details().result() print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listSaasSubscriptionDetails.json +# x-ms-original-file: 2025-03-01/oracleSubscriptions_listSaasSubscriptionDetails.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_create.py deleted file mode 100644 index 3e25c5a3ae21..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_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 typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python virtual_network_addresses_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.virtual_network_addresses.begin_create_or_update( - resource_group_name="rg000", - cloudvmclustername="cluster1", - virtualnetworkaddressname="hostname1", - resource={"properties": {"ipAddress": "192.168.0.1", "vmOcid": "ocid1..aaaa"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_create.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_delete.py deleted file mode 100644 index 70d0e289eb4a..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python virtual_network_addresses_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.virtual_network_addresses.begin_delete( - resource_group_name="rg000", - cloudvmclustername="cluster1", - virtualnetworkaddressname="hostname1", - ).result() - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_delete.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_get.py deleted file mode 100644 index 75c8c8a3cb21..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python virtual_network_addresses_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.virtual_network_addresses.get( - resource_group_name="rg000", - cloudvmclustername="cluster1", - virtualnetworkaddressname="hostname1", - ) - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_get.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_list_by_parent.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_list_by_parent.py deleted file mode 100644 index 0db239b86191..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_list_by_parent.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python virtual_network_addresses_list_by_parent.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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.virtual_network_addresses.list_by_cloud_vm_cluster( - resource_group_name="rg000", - cloudvmclustername="cluster1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_listByParent.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_add_vms.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_add_vms.py index 7778c3c7fa3c..5d4ea813278b 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_add_vms.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_add_vms.py @@ -2,12 +2,10 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -29,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.cloud_vm_clusters.begin_add_vms( @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_addVms.json +# x-ms-original-file: 2025-03-01/vmClusters_addVms.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_create.py deleted file mode 100644 index c92e2274d5a1..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_create.py +++ /dev/null @@ -1,82 +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, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python vm_clusters_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cloud_vm_clusters.begin_create_or_update( - resource_group_name="rg000", - cloudvmclustername="cluster1", - resource={ - "location": "eastus", - "properties": { - "backupSubnetCidr": "172.17.5.0/24", - "cloudExadataInfrastructureId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/cloudExadataInfrastructures/infra1", - "clusterName": "cluster1", - "cpuCoreCount": 2, - "dataCollectionOptions": { - "isDiagnosticsEventsEnabled": False, - "isHealthMonitoringEnabled": False, - "isIncidentLogsEnabled": False, - }, - "dataStoragePercentage": 100, - "dataStorageSizeInTbs": 1000, - "dbNodeStorageSizeInGbs": 1000, - "dbServers": ["ocid1..aaaa"], - "displayName": "cluster 1", - "domain": "domain1", - "giVersion": "19.0.0.0", - "hostname": "hostname1", - "isLocalBackupEnabled": False, - "isSparseDiskgroupEnabled": False, - "licenseModel": "LicenseIncluded", - "memorySizeInGbs": 1000, - "nsgCidrs": [ - {"destinationPortRange": {"max": 1522, "min": 1520}, "source": "10.0.0.0/16"}, - {"source": "10.10.0.0/24"}, - ], - "ocpuCount": 3, - "scanListenerPortTcp": 1050, - "scanListenerPortTcpSsl": 1025, - "sshPublicKeys": ["ssh-key 1"], - "subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", - "timeZone": "UTC", - "vnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1", - }, - "tags": {"tagK1": "tagV1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_create.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_resource_group.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_resource_group.py deleted file mode 100644 index 1390d2135e73..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_resource_group.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.oracledatabase import OracleDatabaseMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-oracledatabase -# USAGE - python vm_clusters_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 = OracleDatabaseMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cloud_vm_clusters.list_by_resource_group( - resource_group_name="rg000", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_private_ip_addresses.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_private_ip_addresses.py index 0305029a1951..df7d378c346a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_private_ip_addresses.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_private_ip_addresses.py @@ -2,12 +2,10 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -29,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.cloud_vm_clusters.list_private_ip_addresses( @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listPrivateIpAddresses.json +# x-ms-original-file: 2025-03-01/vmClusters_listPrivateIpAddresses.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_remove_vms.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_remove_vms.py index 8be29a083d2c..337ce9a3f616 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_remove_vms.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_remove_vms.py @@ -2,12 +2,10 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -29,7 +27,7 @@ def main(): client = OracleDatabaseMgmtClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.cloud_vm_clusters.begin_remove_vms( @@ -40,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_removeVms.json +# x-ms-original-file: 2025-03-01/vmClusters_removeVms.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/conftest.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/conftest.py new file mode 100644 index 000000000000..9cd0ee874ef2 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/conftest.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + oracledatabasemgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations.py new file mode 100644 index 000000000000..c0fdd654b9fa --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabaseBackupsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_backups_begin_create_or_update(self, resource_group): + response = self.client.autonomous_database_backups.begin_create_or_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "autonomousDatabaseOcid": "str", + "backupType": "str", + "databaseSizeInTbs": 0.0, + "dbVersion": "str", + "displayName": "str", + "isAutomatic": bool, + "isRestorable": bool, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "retentionPeriodInDays": 0, + "sizeInTbs": 0.0, + "timeAvailableTil": "2020-02-20 00:00:00", + "timeEnded": "str", + "timeStarted": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_backups_get(self, resource_group): + response = self.client.autonomous_database_backups.get( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_backups_begin_delete(self, resource_group): + response = self.client.autonomous_database_backups.begin_delete( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_backups_begin_update(self, resource_group): + response = self.client.autonomous_database_backups.begin_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + properties={"properties": {"retentionPeriodInDays": 0}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_backups_list_by_parent(self, resource_group): + response = self.client.autonomous_database_backups.list_by_parent( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations_async.py new file mode 100644 index 000000000000..116b3c90cd64 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations_async.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabaseBackupsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_backups_begin_create_or_update(self, resource_group): + response = await ( + await self.client.autonomous_database_backups.begin_create_or_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "autonomousDatabaseOcid": "str", + "backupType": "str", + "databaseSizeInTbs": 0.0, + "dbVersion": "str", + "displayName": "str", + "isAutomatic": bool, + "isRestorable": bool, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "retentionPeriodInDays": 0, + "sizeInTbs": 0.0, + "timeAvailableTil": "2020-02-20 00:00:00", + "timeEnded": "str", + "timeStarted": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_backups_get(self, resource_group): + response = await self.client.autonomous_database_backups.get( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_backups_begin_delete(self, resource_group): + response = await ( + await self.client.autonomous_database_backups.begin_delete( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_backups_begin_update(self, resource_group): + response = await ( + await self.client.autonomous_database_backups.begin_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + properties={"properties": {"retentionPeriodInDays": 0}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_backups_list_by_parent(self, resource_group): + response = self.client.autonomous_database_backups.list_by_parent( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations.py new file mode 100644 index 000000000000..a0ae4a757f33 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabaseCharacterSetsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_character_sets_get(self, resource_group): + response = self.client.autonomous_database_character_sets.get( + location="str", + adbscharsetname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_character_sets_list_by_location(self, resource_group): + response = self.client.autonomous_database_character_sets.list_by_location( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations_async.py new file mode 100644 index 000000000000..21a141c42a3f --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabaseCharacterSetsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_character_sets_get(self, resource_group): + response = await self.client.autonomous_database_character_sets.get( + location="str", + adbscharsetname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_character_sets_list_by_location(self, resource_group): + response = self.client.autonomous_database_character_sets.list_by_location( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations.py new file mode 100644 index 000000000000..dad6d6ef3f33 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabaseNationalCharacterSetsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_national_character_sets_get(self, resource_group): + response = self.client.autonomous_database_national_character_sets.get( + location="str", + adbsncharsetname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_national_character_sets_list_by_location(self, resource_group): + response = self.client.autonomous_database_national_character_sets.list_by_location( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations_async.py new file mode 100644 index 000000000000..1c8d604c3506 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabaseNationalCharacterSetsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_national_character_sets_get(self, resource_group): + response = await self.client.autonomous_database_national_character_sets.get( + location="str", + adbsncharsetname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_national_character_sets_list_by_location(self, resource_group): + response = self.client.autonomous_database_national_character_sets.list_by_location( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations.py new file mode 100644 index 000000000000..d2ca432210b3 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabaseVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_versions_get(self, resource_group): + response = self.client.autonomous_database_versions.get( + location="str", + autonomousdbversionsname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_versions_list_by_location(self, resource_group): + response = self.client.autonomous_database_versions.list_by_location( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations_async.py new file mode 100644 index 000000000000..3db8c4dc0236 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabaseVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_versions_get(self, resource_group): + response = await self.client.autonomous_database_versions.get( + location="str", + autonomousdbversionsname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_versions_list_by_location(self, resource_group): + response = self.client.autonomous_database_versions.list_by_location( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations.py new file mode 100644 index 000000000000..83f6ac3b9dce --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations.py @@ -0,0 +1,210 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabasesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_list_by_subscription(self, resource_group): + response = self.client.autonomous_databases.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_create_or_update(self, resource_group): + response = self.client.autonomous_databases.begin_create_or_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": "autonomous_database_base_properties", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_get(self, resource_group): + response = self.client.autonomous_databases.get( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_delete(self, resource_group): + response = self.client.autonomous_databases.begin_delete( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_update(self, resource_group): + response = self.client.autonomous_databases.begin_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + properties={ + "properties": { + "adminPassword": "str", + "autonomousMaintenanceScheduleType": "str", + "backupRetentionPeriodInDays": 0, + "computeCount": 0.0, + "cpuCoreCount": 0, + "customerContacts": [{"email": "str"}], + "dataStorageSizeInGbs": 0, + "dataStorageSizeInTbs": 0, + "databaseEdition": "str", + "displayName": "str", + "isAutoScalingEnabled": bool, + "isAutoScalingForStorageEnabled": bool, + "isLocalDataGuardEnabled": bool, + "isMtlsConnectionRequired": bool, + "licenseModel": "str", + "localAdgAutoFailoverMaxDataLossLimit": 0, + "longTermBackupSchedule": { + "isDisabled": bool, + "repeatCadence": "str", + "retentionPeriodInDays": 0, + "timeOfBackup": "2020-02-20 00:00:00", + }, + "openMode": "str", + "peerDbId": "str", + "permissionLevel": "str", + "role": "str", + "scheduledOperations": { + "dayOfWeek": {"name": "str"}, + "scheduledStartTime": "str", + "scheduledStopTime": "str", + }, + "whitelistedIps": ["str"], + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_list_by_resource_group(self, resource_group): + response = self.client.autonomous_databases.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_switchover(self, resource_group): + response = self.client.autonomous_databases.begin_switchover( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"peerDbId": "str", "peerDbLocation": "str", "peerDbOcid": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_failover(self, resource_group): + response = self.client.autonomous_databases.begin_failover( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"peerDbId": "str", "peerDbLocation": "str", "peerDbOcid": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_generate_wallet(self, resource_group): + response = self.client.autonomous_databases.generate_wallet( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"password": "str", "generateType": "str", "isRegional": bool}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_restore(self, resource_group): + response = self.client.autonomous_databases.begin_restore( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"timestamp": "2020-02-20 00:00:00"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_shrink(self, resource_group): + response = self.client.autonomous_databases.begin_shrink( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_change_disaster_recovery_configuration(self, resource_group): + response = self.client.autonomous_databases.begin_change_disaster_recovery_configuration( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={ + "disasterRecoveryType": "str", + "isReplicateAutomaticBackups": bool, + "isSnapshotStandby": bool, + "timeSnapshotStandbyEnabledTill": "2020-02-20 00:00:00", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations_async.py new file mode 100644 index 000000000000..930dc21600be --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations_async.py @@ -0,0 +1,227 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtAutonomousDatabasesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_list_by_subscription(self, resource_group): + response = self.client.autonomous_databases.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_create_or_update(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_create_or_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": "autonomous_database_base_properties", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_get(self, resource_group): + response = await self.client.autonomous_databases.get( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_delete(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_delete( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_update(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + properties={ + "properties": { + "adminPassword": "str", + "autonomousMaintenanceScheduleType": "str", + "backupRetentionPeriodInDays": 0, + "computeCount": 0.0, + "cpuCoreCount": 0, + "customerContacts": [{"email": "str"}], + "dataStorageSizeInGbs": 0, + "dataStorageSizeInTbs": 0, + "databaseEdition": "str", + "displayName": "str", + "isAutoScalingEnabled": bool, + "isAutoScalingForStorageEnabled": bool, + "isLocalDataGuardEnabled": bool, + "isMtlsConnectionRequired": bool, + "licenseModel": "str", + "localAdgAutoFailoverMaxDataLossLimit": 0, + "longTermBackupSchedule": { + "isDisabled": bool, + "repeatCadence": "str", + "retentionPeriodInDays": 0, + "timeOfBackup": "2020-02-20 00:00:00", + }, + "openMode": "str", + "peerDbId": "str", + "permissionLevel": "str", + "role": "str", + "scheduledOperations": { + "dayOfWeek": {"name": "str"}, + "scheduledStartTime": "str", + "scheduledStopTime": "str", + }, + "whitelistedIps": ["str"], + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_list_by_resource_group(self, resource_group): + response = self.client.autonomous_databases.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_switchover(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_switchover( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"peerDbId": "str", "peerDbLocation": "str", "peerDbOcid": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_failover(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_failover( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"peerDbId": "str", "peerDbLocation": "str", "peerDbOcid": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_generate_wallet(self, resource_group): + response = await self.client.autonomous_databases.generate_wallet( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"password": "str", "generateType": "str", "isRegional": bool}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_restore(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_restore( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"timestamp": "2020-02-20 00:00:00"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_shrink(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_shrink( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_change_disaster_recovery_configuration(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_change_disaster_recovery_configuration( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={ + "disasterRecoveryType": "str", + "isReplicateAutomaticBackups": bool, + "isSnapshotStandby": bool, + "timeSnapshotStandbyEnabledTill": "2020-02-20 00:00:00", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations.py new file mode 100644 index 000000000000..c372b1308c5f --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations.py @@ -0,0 +1,185 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtCloudExadataInfrastructuresOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_list_by_subscription(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_begin_create_or_update(self, resource_group): + response = self.client.cloud_exadata_infrastructures.begin_create_or_update( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + resource={ + "location": "str", + "zones": ["str"], + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "shape": "str", + "activatedStorageCount": 0, + "additionalStorageCount": 0, + "availableStorageSizeInGbs": 0, + "computeCount": 0, + "computeModel": "str", + "cpuCount": 0, + "customerContacts": [{"email": "str"}], + "dataStorageSizeInTbs": 0.0, + "databaseServerType": "str", + "dbNodeStorageSizeInGbs": 0, + "dbServerVersion": "str", + "definedFileSystemConfiguration": [ + {"isBackupPartition": bool, "isResizable": bool, "minSizeGb": 0, "mountPoint": "str"} + ], + "estimatedPatchingTime": { + "estimatedDbServerPatchingTime": 0, + "estimatedNetworkSwitchesPatchingTime": 0, + "estimatedStorageServerPatchingTime": 0, + "totalEstimatedPatchingTime": 0, + }, + "lastMaintenanceRunId": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "maintenanceWindow": { + "customActionTimeoutInMins": 0, + "daysOfWeek": [{"name": "str"}], + "hoursOfDay": [0], + "isCustomActionTimeoutEnabled": bool, + "isMonthlyPatchingEnabled": bool, + "leadTimeInWeeks": 0, + "months": [{"name": "str"}], + "patchingMode": "str", + "preference": "str", + "weeksOfMonth": [0], + }, + "maxCpuCount": 0, + "maxDataStorageInTbs": 0.0, + "maxDbNodeStorageSizeInGbs": 0, + "maxMemoryInGbs": 0, + "memorySizeInGbs": 0, + "monthlyDbServerVersion": "str", + "monthlyStorageServerVersion": "str", + "nextMaintenanceRunId": "str", + "ociUrl": "str", + "ocid": "str", + "provisioningState": "str", + "storageCount": 0, + "storageServerType": "str", + "storageServerVersion": "str", + "timeCreated": "str", + "totalStorageSizeInGbs": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_get(self, resource_group): + response = self.client.cloud_exadata_infrastructures.get( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_begin_update(self, resource_group): + response = self.client.cloud_exadata_infrastructures.begin_update( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + properties={ + "properties": { + "computeCount": 0, + "customerContacts": [{"email": "str"}], + "displayName": "str", + "maintenanceWindow": { + "customActionTimeoutInMins": 0, + "daysOfWeek": [{"name": "str"}], + "hoursOfDay": [0], + "isCustomActionTimeoutEnabled": bool, + "isMonthlyPatchingEnabled": bool, + "leadTimeInWeeks": 0, + "months": [{"name": "str"}], + "patchingMode": "str", + "preference": "str", + "weeksOfMonth": [0], + }, + "storageCount": 0, + }, + "tags": {"str": "str"}, + "zones": ["str"], + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_begin_delete(self, resource_group): + response = self.client.cloud_exadata_infrastructures.begin_delete( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_list_by_resource_group(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_begin_add_storage_capacity(self, resource_group): + response = self.client.cloud_exadata_infrastructures.begin_add_storage_capacity( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async.py new file mode 100644 index 000000000000..7d7cab6c26e9 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async.py @@ -0,0 +1,194 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtCloudExadataInfrastructuresOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_list_by_subscription(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_begin_create_or_update(self, resource_group): + response = await ( + await self.client.cloud_exadata_infrastructures.begin_create_or_update( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + resource={ + "location": "str", + "zones": ["str"], + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "shape": "str", + "activatedStorageCount": 0, + "additionalStorageCount": 0, + "availableStorageSizeInGbs": 0, + "computeCount": 0, + "computeModel": "str", + "cpuCount": 0, + "customerContacts": [{"email": "str"}], + "dataStorageSizeInTbs": 0.0, + "databaseServerType": "str", + "dbNodeStorageSizeInGbs": 0, + "dbServerVersion": "str", + "definedFileSystemConfiguration": [ + {"isBackupPartition": bool, "isResizable": bool, "minSizeGb": 0, "mountPoint": "str"} + ], + "estimatedPatchingTime": { + "estimatedDbServerPatchingTime": 0, + "estimatedNetworkSwitchesPatchingTime": 0, + "estimatedStorageServerPatchingTime": 0, + "totalEstimatedPatchingTime": 0, + }, + "lastMaintenanceRunId": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "maintenanceWindow": { + "customActionTimeoutInMins": 0, + "daysOfWeek": [{"name": "str"}], + "hoursOfDay": [0], + "isCustomActionTimeoutEnabled": bool, + "isMonthlyPatchingEnabled": bool, + "leadTimeInWeeks": 0, + "months": [{"name": "str"}], + "patchingMode": "str", + "preference": "str", + "weeksOfMonth": [0], + }, + "maxCpuCount": 0, + "maxDataStorageInTbs": 0.0, + "maxDbNodeStorageSizeInGbs": 0, + "maxMemoryInGbs": 0, + "memorySizeInGbs": 0, + "monthlyDbServerVersion": "str", + "monthlyStorageServerVersion": "str", + "nextMaintenanceRunId": "str", + "ociUrl": "str", + "ocid": "str", + "provisioningState": "str", + "storageCount": 0, + "storageServerType": "str", + "storageServerVersion": "str", + "timeCreated": "str", + "totalStorageSizeInGbs": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_get(self, resource_group): + response = await self.client.cloud_exadata_infrastructures.get( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_begin_update(self, resource_group): + response = await ( + await self.client.cloud_exadata_infrastructures.begin_update( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + properties={ + "properties": { + "computeCount": 0, + "customerContacts": [{"email": "str"}], + "displayName": "str", + "maintenanceWindow": { + "customActionTimeoutInMins": 0, + "daysOfWeek": [{"name": "str"}], + "hoursOfDay": [0], + "isCustomActionTimeoutEnabled": bool, + "isMonthlyPatchingEnabled": bool, + "leadTimeInWeeks": 0, + "months": [{"name": "str"}], + "patchingMode": "str", + "preference": "str", + "weeksOfMonth": [0], + }, + "storageCount": 0, + }, + "tags": {"str": "str"}, + "zones": ["str"], + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_begin_delete(self, resource_group): + response = await ( + await self.client.cloud_exadata_infrastructures.begin_delete( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_list_by_resource_group(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_begin_add_storage_capacity(self, resource_group): + response = await ( + await self.client.cloud_exadata_infrastructures.begin_add_storage_capacity( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations.py new file mode 100644 index 000000000000..5067312fe396 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations.py @@ -0,0 +1,214 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtCloudVmClustersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_begin_create_or_update(self, resource_group): + response = self.client.cloud_vm_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "cloudExadataInfrastructureId": "str", + "cpuCoreCount": 0, + "displayName": "str", + "giVersion": "str", + "hostname": "str", + "sshPublicKeys": ["str"], + "subnetId": "str", + "vnetId": "str", + "backupSubnetCidr": "str", + "clusterName": "str", + "compartmentId": "str", + "computeModel": "str", + "computeNodes": ["str"], + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": bool, + "isHealthMonitoringEnabled": bool, + "isIncidentLogsEnabled": bool, + }, + "dataStoragePercentage": 0, + "dataStorageSizeInTbs": 0.0, + "dbNodeStorageSizeInGbs": 0, + "dbServers": ["str"], + "diskRedundancy": "str", + "domain": "str", + "fileSystemConfigurationDetails": [{"fileSystemSizeGb": 0, "mountPoint": "str"}], + "iormConfigCache": { + "dbPlans": [{"dbName": "str", "flashCacheLimit": "str", "share": 0}], + "lifecycleDetails": "str", + "lifecycleState": "str", + "objective": "str", + }, + "isLocalBackupEnabled": bool, + "isSparseDiskgroupEnabled": bool, + "lastUpdateHistoryEntryId": "str", + "licenseModel": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "listenerPort": 0, + "memorySizeInGbs": 0, + "nodeCount": 0, + "nsgCidrs": [{"source": "str", "destinationPortRange": {"max": 0, "min": 0}}], + "nsgUrl": "str", + "ociUrl": "str", + "ocid": "str", + "ocpuCount": 0.0, + "provisioningState": "str", + "scanDnsName": "str", + "scanDnsRecordId": "str", + "scanIpIds": ["str"], + "scanListenerPortTcp": 0, + "scanListenerPortTcpSsl": 0, + "shape": "str", + "storageSizeInGbs": 0, + "subnetOcid": "str", + "systemVersion": "str", + "timeCreated": "2020-02-20 00:00:00", + "timeZone": "str", + "vipIds": ["str"], + "zoneId": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_get(self, resource_group): + response = self.client.cloud_vm_clusters.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_begin_update(self, resource_group): + response = self.client.cloud_vm_clusters.begin_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + properties={ + "properties": { + "computeNodes": ["str"], + "cpuCoreCount": 0, + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": bool, + "isHealthMonitoringEnabled": bool, + "isIncidentLogsEnabled": bool, + }, + "dataStorageSizeInTbs": 0.0, + "dbNodeStorageSizeInGbs": 0, + "displayName": "str", + "fileSystemConfigurationDetails": [{"fileSystemSizeGb": 0, "mountPoint": "str"}], + "licenseModel": "str", + "memorySizeInGbs": 0, + "ocpuCount": 0.0, + "sshPublicKeys": ["str"], + "storageSizeInGbs": 0, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_begin_delete(self, resource_group): + response = self.client.cloud_vm_clusters.begin_delete( + resource_group_name=resource_group.name, + cloudvmclustername="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_begin_add_vms(self, resource_group): + response = self.client.cloud_vm_clusters.begin_add_vms( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"dbServers": ["str"]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_begin_remove_vms(self, resource_group): + response = self.client.cloud_vm_clusters.begin_remove_vms( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"dbServers": ["str"]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_list_private_ip_addresses(self, resource_group): + response = self.client.cloud_vm_clusters.list_private_ip_addresses( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"subnetId": "str", "vnicId": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async.py new file mode 100644 index 000000000000..ec74027354b5 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async.py @@ -0,0 +1,225 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtCloudVmClustersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_begin_create_or_update(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "cloudExadataInfrastructureId": "str", + "cpuCoreCount": 0, + "displayName": "str", + "giVersion": "str", + "hostname": "str", + "sshPublicKeys": ["str"], + "subnetId": "str", + "vnetId": "str", + "backupSubnetCidr": "str", + "clusterName": "str", + "compartmentId": "str", + "computeModel": "str", + "computeNodes": ["str"], + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": bool, + "isHealthMonitoringEnabled": bool, + "isIncidentLogsEnabled": bool, + }, + "dataStoragePercentage": 0, + "dataStorageSizeInTbs": 0.0, + "dbNodeStorageSizeInGbs": 0, + "dbServers": ["str"], + "diskRedundancy": "str", + "domain": "str", + "fileSystemConfigurationDetails": [{"fileSystemSizeGb": 0, "mountPoint": "str"}], + "iormConfigCache": { + "dbPlans": [{"dbName": "str", "flashCacheLimit": "str", "share": 0}], + "lifecycleDetails": "str", + "lifecycleState": "str", + "objective": "str", + }, + "isLocalBackupEnabled": bool, + "isSparseDiskgroupEnabled": bool, + "lastUpdateHistoryEntryId": "str", + "licenseModel": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "listenerPort": 0, + "memorySizeInGbs": 0, + "nodeCount": 0, + "nsgCidrs": [{"source": "str", "destinationPortRange": {"max": 0, "min": 0}}], + "nsgUrl": "str", + "ociUrl": "str", + "ocid": "str", + "ocpuCount": 0.0, + "provisioningState": "str", + "scanDnsName": "str", + "scanDnsRecordId": "str", + "scanIpIds": ["str"], + "scanListenerPortTcp": 0, + "scanListenerPortTcpSsl": 0, + "shape": "str", + "storageSizeInGbs": 0, + "subnetOcid": "str", + "systemVersion": "str", + "timeCreated": "2020-02-20 00:00:00", + "timeZone": "str", + "vipIds": ["str"], + "zoneId": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_get(self, resource_group): + response = await self.client.cloud_vm_clusters.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_begin_update(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + properties={ + "properties": { + "computeNodes": ["str"], + "cpuCoreCount": 0, + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": bool, + "isHealthMonitoringEnabled": bool, + "isIncidentLogsEnabled": bool, + }, + "dataStorageSizeInTbs": 0.0, + "dbNodeStorageSizeInGbs": 0, + "displayName": "str", + "fileSystemConfigurationDetails": [{"fileSystemSizeGb": 0, "mountPoint": "str"}], + "licenseModel": "str", + "memorySizeInGbs": 0, + "ocpuCount": 0.0, + "sshPublicKeys": ["str"], + "storageSizeInGbs": 0, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_begin_delete(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_delete( + resource_group_name=resource_group.name, + cloudvmclustername="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_begin_add_vms(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_add_vms( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"dbServers": ["str"]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_begin_remove_vms(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_remove_vms( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"dbServers": ["str"]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_list_private_ip_addresses(self, resource_group): + response = await self.client.cloud_vm_clusters.list_private_ip_addresses( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"subnetId": "str", "vnicId": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations.py new file mode 100644 index 000000000000..bbb558418519 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDbNodesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_nodes_get(self, resource_group): + response = self.client.db_nodes.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + dbnodeocid="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_nodes_list_by_parent(self, resource_group): + response = self.client.db_nodes.list_by_parent( + resource_group_name=resource_group.name, + cloudvmclustername="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_nodes_begin_action(self, resource_group): + response = self.client.db_nodes.begin_action( + resource_group_name=resource_group.name, + cloudvmclustername="str", + dbnodeocid="str", + body={"action": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations_async.py new file mode 100644 index 000000000000..a618d2b5b957 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations_async.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDbNodesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_nodes_get(self, resource_group): + response = await self.client.db_nodes.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + dbnodeocid="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_nodes_list_by_parent(self, resource_group): + response = self.client.db_nodes.list_by_parent( + resource_group_name=resource_group.name, + cloudvmclustername="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_nodes_begin_action(self, resource_group): + response = await ( + await self.client.db_nodes.begin_action( + resource_group_name=resource_group.name, + cloudvmclustername="str", + dbnodeocid="str", + body={"action": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations.py new file mode 100644 index 000000000000..eeda5755dd1a --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDbServersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_servers_get(self, resource_group): + response = self.client.db_servers.get( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + dbserverocid="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_servers_list_by_parent(self, resource_group): + response = self.client.db_servers.list_by_parent( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations_async.py new file mode 100644 index 000000000000..6e61d7f52ee5 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations_async.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDbServersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_servers_get(self, resource_group): + response = await self.client.db_servers.get( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + dbserverocid="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_servers_list_by_parent(self, resource_group): + response = self.client.db_servers.list_by_parent( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations.py new file mode 100644 index 000000000000..4fbebe5a953b --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDbSystemShapesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_system_shapes_get(self, resource_group): + response = self.client.db_system_shapes.get( + location="str", + dbsystemshapename="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_system_shapes_list_by_location(self, resource_group): + response = self.client.db_system_shapes.list_by_location( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations_async.py new file mode 100644 index 000000000000..2e42a0ad1b11 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDbSystemShapesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_system_shapes_get(self, resource_group): + response = await self.client.db_system_shapes.get( + location="str", + dbsystemshapename="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_system_shapes_list_by_location(self, resource_group): + response = self.client.db_system_shapes.list_by_location( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations.py new file mode 100644 index 000000000000..035b212af1a1 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDnsPrivateViewsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_dns_private_views_get(self, resource_group): + response = self.client.dns_private_views.get( + location="str", + dnsprivateviewocid="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_dns_private_views_list_by_location(self, resource_group): + response = self.client.dns_private_views.list_by_location( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations_async.py new file mode 100644 index 000000000000..8cf44c55e54f --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDnsPrivateViewsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_dns_private_views_get(self, resource_group): + response = await self.client.dns_private_views.get( + location="str", + dnsprivateviewocid="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_dns_private_views_list_by_location(self, resource_group): + response = self.client.dns_private_views.list_by_location( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations.py new file mode 100644 index 000000000000..6367cacfbae0 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDnsPrivateZonesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_dns_private_zones_get(self, resource_group): + response = self.client.dns_private_zones.get( + location="str", + dnsprivatezonename="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_dns_private_zones_list_by_location(self, resource_group): + response = self.client.dns_private_zones.list_by_location( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations_async.py new file mode 100644 index 000000000000..3a94a5deedc6 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtDnsPrivateZonesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_dns_private_zones_get(self, resource_group): + response = await self.client.dns_private_zones.get( + location="str", + dnsprivatezonename="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_dns_private_zones_list_by_location(self, resource_group): + response = self.client.dns_private_zones.list_by_location( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations.py new file mode 100644 index 000000000000..094f2cfd8b1d --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations.py @@ -0,0 +1,164 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtExadbVmClustersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_begin_create_or_update(self, resource_group): + response = self.client.exadb_vm_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "enabledEcpuCount": 0, + "exascaleDbStorageVaultId": "str", + "hostname": "str", + "nodeCount": 0, + "shape": "str", + "sshPublicKeys": ["str"], + "subnetId": "str", + "totalEcpuCount": 0, + "vmFileSystemStorage": {"totalSizeInGbs": 0}, + "vnetId": "str", + "backupSubnetCidr": "str", + "backupSubnetOcid": "str", + "clusterName": "str", + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": bool, + "isHealthMonitoringEnabled": bool, + "isIncidentLogsEnabled": bool, + }, + "domain": "str", + "giVersion": "str", + "gridImageOcid": "str", + "gridImageType": "str", + "iormConfigCache": { + "dbPlans": [{"dbName": "str", "flashCacheLimit": "str", "share": 0}], + "lifecycleDetails": "str", + "lifecycleState": "str", + "objective": "str", + }, + "licenseModel": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "listenerPort": 0, + "memorySizeInGbs": 0, + "nsgCidrs": [{"source": "str", "destinationPortRange": {"max": 0, "min": 0}}], + "nsgUrl": "str", + "ociUrl": "str", + "ocid": "str", + "privateZoneOcid": "str", + "provisioningState": "str", + "scanDnsName": "str", + "scanDnsRecordId": "str", + "scanIpIds": ["str"], + "scanListenerPortTcp": 0, + "scanListenerPortTcpSsl": 0, + "snapshotFileSystemStorage": {"totalSizeInGbs": 0}, + "subnetOcid": "str", + "systemVersion": "str", + "timeZone": "str", + "totalFileSystemStorage": {"totalSizeInGbs": 0}, + "vipIds": ["str"], + "zoneOcid": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + "zones": ["str"], + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_get(self, resource_group): + response = self.client.exadb_vm_clusters.get( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_begin_update(self, resource_group): + response = self.client.exadb_vm_clusters.begin_update( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + properties={"properties": {"nodeCount": 0}, "tags": {"str": "str"}, "zones": ["str"]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_begin_delete(self, resource_group): + response = self.client.exadb_vm_clusters.begin_delete( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_begin_remove_vms(self, resource_group): + response = self.client.exadb_vm_clusters.begin_remove_vms( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + body={"dbNodes": [{"dbNodeId": "str"}]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async.py new file mode 100644 index 000000000000..6a00b02bd979 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async.py @@ -0,0 +1,173 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtExadbVmClustersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_begin_create_or_update(self, resource_group): + response = await ( + await self.client.exadb_vm_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "enabledEcpuCount": 0, + "exascaleDbStorageVaultId": "str", + "hostname": "str", + "nodeCount": 0, + "shape": "str", + "sshPublicKeys": ["str"], + "subnetId": "str", + "totalEcpuCount": 0, + "vmFileSystemStorage": {"totalSizeInGbs": 0}, + "vnetId": "str", + "backupSubnetCidr": "str", + "backupSubnetOcid": "str", + "clusterName": "str", + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": bool, + "isHealthMonitoringEnabled": bool, + "isIncidentLogsEnabled": bool, + }, + "domain": "str", + "giVersion": "str", + "gridImageOcid": "str", + "gridImageType": "str", + "iormConfigCache": { + "dbPlans": [{"dbName": "str", "flashCacheLimit": "str", "share": 0}], + "lifecycleDetails": "str", + "lifecycleState": "str", + "objective": "str", + }, + "licenseModel": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "listenerPort": 0, + "memorySizeInGbs": 0, + "nsgCidrs": [{"source": "str", "destinationPortRange": {"max": 0, "min": 0}}], + "nsgUrl": "str", + "ociUrl": "str", + "ocid": "str", + "privateZoneOcid": "str", + "provisioningState": "str", + "scanDnsName": "str", + "scanDnsRecordId": "str", + "scanIpIds": ["str"], + "scanListenerPortTcp": 0, + "scanListenerPortTcpSsl": 0, + "snapshotFileSystemStorage": {"totalSizeInGbs": 0}, + "subnetOcid": "str", + "systemVersion": "str", + "timeZone": "str", + "totalFileSystemStorage": {"totalSizeInGbs": 0}, + "vipIds": ["str"], + "zoneOcid": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + "zones": ["str"], + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_get(self, resource_group): + response = await self.client.exadb_vm_clusters.get( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_begin_update(self, resource_group): + response = await ( + await self.client.exadb_vm_clusters.begin_update( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + properties={"properties": {"nodeCount": 0}, "tags": {"str": "str"}, "zones": ["str"]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_begin_delete(self, resource_group): + response = await ( + await self.client.exadb_vm_clusters.begin_delete( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_begin_remove_vms(self, resource_group): + response = await ( + await self.client.exadb_vm_clusters.begin_remove_vms( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + body={"dbNodes": [{"dbNodeId": "str"}]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations.py new file mode 100644 index 000000000000..e59a0f8efbf8 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtExascaleDbNodesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_nodes_get(self, resource_group): + response = self.client.exascale_db_nodes.get( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + exascale_db_node_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_nodes_list_by_parent(self, resource_group): + response = self.client.exascale_db_nodes.list_by_parent( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_nodes_begin_action(self, resource_group): + response = self.client.exascale_db_nodes.begin_action( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + exascale_db_node_name="str", + body={"action": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations_async.py new file mode 100644 index 000000000000..0072244226f2 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations_async.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtExascaleDbNodesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_nodes_get(self, resource_group): + response = await self.client.exascale_db_nodes.get( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + exascale_db_node_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_nodes_list_by_parent(self, resource_group): + response = self.client.exascale_db_nodes.list_by_parent( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_nodes_begin_action(self, resource_group): + response = await ( + await self.client.exascale_db_nodes.begin_action( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + exascale_db_node_name="str", + body={"action": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations.py new file mode 100644 index 000000000000..0297653e1dd7 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtExascaleDbStorageVaultsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_get(self, resource_group): + response = self.client.exascale_db_storage_vaults.get( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_begin_create(self, resource_group): + response = self.client.exascale_db_storage_vaults.begin_create( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "highCapacityDatabaseStorageInput": {"totalSizeInGbs": 0}, + "additionalFlashCacheInPercent": 0, + "description": "str", + "highCapacityDatabaseStorage": {"availableSizeInGbs": 0, "totalSizeInGbs": 0}, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ociUrl": "str", + "ocid": "str", + "provisioningState": "str", + "timeZone": "str", + "vmClusterCount": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + "zones": ["str"], + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_begin_update(self, resource_group): + response = self.client.exascale_db_storage_vaults.begin_update( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + properties={"tags": {"str": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_begin_delete(self, resource_group): + response = self.client.exascale_db_storage_vaults.begin_delete( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_list_by_resource_group(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_list_by_subscription(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async.py new file mode 100644 index 000000000000..1a17ea181bb3 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async.py @@ -0,0 +1,119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtExascaleDbStorageVaultsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_get(self, resource_group): + response = await self.client.exascale_db_storage_vaults.get( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_begin_create(self, resource_group): + response = await ( + await self.client.exascale_db_storage_vaults.begin_create( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "highCapacityDatabaseStorageInput": {"totalSizeInGbs": 0}, + "additionalFlashCacheInPercent": 0, + "description": "str", + "highCapacityDatabaseStorage": {"availableSizeInGbs": 0, "totalSizeInGbs": 0}, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ociUrl": "str", + "ocid": "str", + "provisioningState": "str", + "timeZone": "str", + "vmClusterCount": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + "zones": ["str"], + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_begin_update(self, resource_group): + response = await ( + await self.client.exascale_db_storage_vaults.begin_update( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + properties={"tags": {"str": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_begin_delete(self, resource_group): + response = await ( + await self.client.exascale_db_storage_vaults.begin_delete( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_list_by_resource_group(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_list_by_subscription(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations.py new file mode 100644 index 000000000000..cde2a25013cc --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtFlexComponentsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flex_components_get(self, resource_group): + response = self.client.flex_components.get( + location="str", + flex_component_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flex_components_list_by_parent(self, resource_group): + response = self.client.flex_components.list_by_parent( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations_async.py new file mode 100644 index 000000000000..692dc0143341 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtFlexComponentsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flex_components_get(self, resource_group): + response = await self.client.flex_components.get( + location="str", + flex_component_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flex_components_list_by_parent(self, resource_group): + response = self.client.flex_components.list_by_parent( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations.py new file mode 100644 index 000000000000..5c0afc46aa2e --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtGiMinorVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_gi_minor_versions_list_by_parent(self, resource_group): + response = self.client.gi_minor_versions.list_by_parent( + location="str", + giversionname="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_gi_minor_versions_get(self, resource_group): + response = self.client.gi_minor_versions.get( + location="str", + giversionname="str", + gi_minor_version_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations_async.py new file mode 100644 index 000000000000..5a0648eb329d --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations_async.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtGiMinorVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_gi_minor_versions_list_by_parent(self, resource_group): + response = self.client.gi_minor_versions.list_by_parent( + location="str", + giversionname="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_gi_minor_versions_get(self, resource_group): + response = await self.client.gi_minor_versions.get( + location="str", + giversionname="str", + gi_minor_version_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations.py new file mode 100644 index 000000000000..a1a89f4343f7 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtGiVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_gi_versions_get(self, resource_group): + response = self.client.gi_versions.get( + location="str", + giversionname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_gi_versions_list_by_location(self, resource_group): + response = self.client.gi_versions.list_by_location( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations_async.py new file mode 100644 index 000000000000..1a4bce25a604 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtGiVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_gi_versions_get(self, resource_group): + response = await self.client.gi_versions.get( + location="str", + giversionname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_gi_versions_list_by_location(self, resource_group): + response = self.client.gi_versions.list_by_location( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations.py new file mode 100644 index 000000000000..200b96e3faf9 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations_async.py new file mode 100644 index 000000000000..cbf43cfe5edd --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations_async.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations.py new file mode 100644 index 000000000000..cba467d0769b --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations.py @@ -0,0 +1,133 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtOracleSubscriptionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_list_by_subscription(self, resource_group): + response = self.client.oracle_subscriptions.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_begin_create_or_update(self, resource_group): + response = self.client.oracle_subscriptions.begin_create_or_update( + resource={ + "id": "str", + "name": "str", + "plan": {"name": "str", "product": "str", "publisher": "str", "promotionCode": "str", "version": "str"}, + "properties": { + "addSubscriptionOperationState": "str", + "azureSubscriptionIds": ["str"], + "cloudAccountId": "str", + "cloudAccountState": "str", + "intent": "str", + "lastOperationStatusDetail": "str", + "productCode": "str", + "provisioningState": "str", + "saasSubscriptionId": "str", + "termUnit": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_get(self, resource_group): + response = self.client.oracle_subscriptions.get() + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_begin_update(self, resource_group): + response = self.client.oracle_subscriptions.begin_update( + properties={ + "plan": {"name": "str", "product": "str", "promotionCode": "str", "publisher": "str", "version": "str"}, + "properties": {"intent": "str", "productCode": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_begin_delete(self, resource_group): + response = ( + self.client.oracle_subscriptions.begin_delete().result() + ) # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_begin_list_cloud_account_details(self, resource_group): + response = ( + self.client.oracle_subscriptions.begin_list_cloud_account_details().result() + ) # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_begin_list_saas_subscription_details(self, resource_group): + response = ( + self.client.oracle_subscriptions.begin_list_saas_subscription_details().result() + ) # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_begin_list_activation_links(self, resource_group): + response = ( + self.client.oracle_subscriptions.begin_list_activation_links().result() + ) # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_begin_add_azure_subscriptions(self, resource_group): + response = self.client.oracle_subscriptions.begin_add_azure_subscriptions( + body={"azureSubscriptionIds": ["str"]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations_async.py new file mode 100644 index 000000000000..5cbd122de69b --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations_async.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtOracleSubscriptionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_list_by_subscription(self, resource_group): + response = self.client.oracle_subscriptions.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_begin_create_or_update(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_create_or_update( + resource={ + "id": "str", + "name": "str", + "plan": { + "name": "str", + "product": "str", + "publisher": "str", + "promotionCode": "str", + "version": "str", + }, + "properties": { + "addSubscriptionOperationState": "str", + "azureSubscriptionIds": ["str"], + "cloudAccountId": "str", + "cloudAccountState": "str", + "intent": "str", + "lastOperationStatusDetail": "str", + "productCode": "str", + "provisioningState": "str", + "saasSubscriptionId": "str", + "termUnit": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_get(self, resource_group): + response = await self.client.oracle_subscriptions.get() + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_begin_update(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_update( + properties={ + "plan": { + "name": "str", + "product": "str", + "promotionCode": "str", + "publisher": "str", + "version": "str", + }, + "properties": {"intent": "str", "productCode": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_begin_delete(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_delete() + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_begin_list_cloud_account_details(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_list_cloud_account_details() + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_begin_list_saas_subscription_details(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_list_saas_subscription_details() + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_begin_list_activation_links(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_list_activation_links() + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_begin_add_azure_subscriptions(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_add_azure_subscriptions( + body={"azureSubscriptionIds": ["str"]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations.py new file mode 100644 index 000000000000..9ce574f27f7f --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtSystemVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_system_versions_get(self, resource_group): + response = self.client.system_versions.get( + location="str", + systemversionname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_system_versions_list_by_location(self, resource_group): + response = self.client.system_versions.list_by_location( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations_async.py new file mode 100644 index 000000000000..b7fd9da21e12 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtSystemVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_system_versions_get(self, resource_group): + response = await self.client.system_versions.get( + location="str", + systemversionname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_system_versions_list_by_location(self, resource_group): + response = self.client.system_versions.list_by_location( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations.py new file mode 100644 index 000000000000..3121f211c103 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtVirtualNetworkAddressesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_network_addresses_begin_create_or_update(self, resource_group): + response = self.client.virtual_network_addresses.begin_create_or_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "domain": "str", + "ipAddress": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "timeAssigned": "2020-02-20 00:00:00", + "vmOcid": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_network_addresses_get(self, resource_group): + response = self.client.virtual_network_addresses.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_network_addresses_begin_delete(self, resource_group): + response = self.client.virtual_network_addresses.begin_delete( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_network_addresses_list_by_parent(self, resource_group): + response = self.client.virtual_network_addresses.list_by_parent( + resource_group_name=resource_group.name, + cloudvmclustername="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations_async.py new file mode 100644 index 000000000000..7e9707651cec --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations_async.py @@ -0,0 +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. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestOracleDatabaseMgmtVirtualNetworkAddressesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_network_addresses_begin_create_or_update(self, resource_group): + response = await ( + await self.client.virtual_network_addresses.begin_create_or_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "domain": "str", + "ipAddress": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "timeAssigned": "2020-02-20 00:00:00", + "vmOcid": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_network_addresses_get(self, resource_group): + response = await self.client.virtual_network_addresses.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_network_addresses_begin_delete(self, resource_group): + response = await ( + await self.client.virtual_network_addresses.begin_delete( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_network_addresses_list_by_parent(self, resource_group): + response = self.client.virtual_network_addresses.list_by_parent( + resource_group_name=resource_group.name, + cloudvmclustername="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/setup.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/setup.py index fd71a882c04b..4caf0c79726c 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/setup.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/setup.py @@ -53,7 +53,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -75,8 +74,9 @@ }, install_requires=[ "isodate>=0.6.1", + "typing-extensions>=4.6.0", "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", + "azure-mgmt-core>=1.5.0", ], - python_requires=">=3.8", + python_requires=">=3.9", ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/conftest.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/conftest.py index 587e126e50b0..9cd0ee874ef2 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/conftest.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/conftest.py @@ -1,50 +1,35 @@ +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os -import platform import pytest -import sys - from dotenv import load_dotenv - -from devtools_testutils import test_proxy, add_general_regex_sanitizer -from devtools_testutils import add_header_regex_sanitizer, add_body_key_sanitizer +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) load_dotenv() + +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): - subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") - client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") - client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=subscription_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=tenant_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=client_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=client_secret, value="00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_client_secret, value="00000000-0000-0000-0000-000000000000") + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") add_header_regex_sanitizer(key="Cookie", value="cookie;") - add_body_key_sanitizer(json_path="$..access_token", value="access_token") \ No newline at end of file + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_cli_mgmt_oracledatabase.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_cli_mgmt_oracledatabase.py deleted file mode 100644 index 478e5f6a3ad1..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_cli_mgmt_oracledatabase.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. -#-------------------------------------------------------------------------- -import pytest -from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = 'eastus' - -class TestMgmtOracleDatabase(AzureMgmtRecordedTestCase): - - def setup_method(self, method): - self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_cloud_vm_clusters_by_resource_group(self, resource_group): - assert list(self.client.cloud_vm_clusters.list_by_resource_group(resource_group.name)) == [] - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_cloud_exadata_infrastructures_by_resource_group(self, resource_group): - assert list(self.client.cloud_exadata_infrastructures.list_by_resource_group(resource_group.name)) == [] - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_autonomous_databases_by_resource_group(self, resource_group): - assert list(self.client.autonomous_databases.list_by_resource_group(resource_group.name)) == [] - - @pytest.mark.skip("Lack of permission") - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_db_system_shapes_by_resource_group(self, resource_group): - assert list(self.client.db_system_shapes.list_by_location(location=AZURE_LOCATION)) == [] - - @recorded_by_proxy - def test_list_operations(self): - assert list(self.client.operations.list()) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_cli_mgmt_oracledatabase_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_cli_mgmt_oracledatabase_async.py deleted file mode 100644 index c7119cd61afa..000000000000 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_cli_mgmt_oracledatabase_async.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 -#------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -#-------------------------------------------------------------------------- -import pytest -from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = 'eastus' - -class TestMgmtOracleDatabaseAsync(AzureMgmtRecordedTestCase): - - def setup_method(self, method): - self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_cloud_vm_clusters_by_resource_group(self, resource_group): - response = self.client.cloud_vm_clusters.list_by_resource_group(resource_group.name) - assert [r async for r in response] == [] - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_cloud_exadata_infrastructures_by_resource_group(self, resource_group): - response = self.client.cloud_exadata_infrastructures.list_by_resource_group(resource_group.name) - assert [r async for r in response] == [] - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_autonomous_databases_by_resource_group(self, resource_group): - response = self.client.autonomous_databases.list_by_resource_group(resource_group.name) - assert [r async for r in response] == [] - - @pytest.mark.skip("Lack of permission") - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_db_system_shapes_by_resource_group(self, resource_group): - response = self.client.db_system_shapes.list_by_location(location=AZURE_LOCATION) - assert [r async for r in response] == [] - - @recorded_by_proxy_async - async def test_list_operations(self): - response = self.client.operations.list() - assert len([r async for r in response]) > 0 diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_autonomous_databases_operations_async_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_autonomous_databases_operations_async_test.py new file mode 100644 index 000000000000..2bc63c2b2cec --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_autonomous_databases_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtAutonomousDatabasesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_list_by_subscription(self, resource_group): + response = self.client.autonomous_databases.list_by_subscription() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_list_by_resource_group(self, resource_group): + response = self.client.autonomous_databases.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_autonomous_databases_operations_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_autonomous_databases_operations_test.py new file mode 100644 index 000000000000..fa58423fe9f5 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_autonomous_databases_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtAutonomousDatabasesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_list_by_subscription(self, resource_group): + response = self.client.autonomous_databases.list_by_subscription() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_list_by_resource_group(self, resource_group): + response = self.client.autonomous_databases.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async_test.py new file mode 100644 index 000000000000..e7de1a813d8b --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtCloudExadataInfrastructuresOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_list_by_subscription(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_subscription() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_list_by_resource_group(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_test.py new file mode 100644 index 000000000000..e57bd4a86f11 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtCloudExadataInfrastructuresOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_list_by_subscription(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_subscription() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_list_by_resource_group(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async_test.py new file mode 100644 index 000000000000..b5b049d6645a --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtCloudVmClustersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_subscription() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_test.py new file mode 100644 index 000000000000..61328858aec9 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtCloudVmClustersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_subscription() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async_test.py new file mode 100644 index 000000000000..beab194da911 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtExadbVmClustersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_subscription() + result = [r async for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_test.py new file mode 100644 index 000000000000..b1700b213b91 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtExadbVmClustersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_subscription() + result = [r for r in response] + assert response + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async_test.py new file mode 100644 index 000000000000..2ab8897681c5 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async_test.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtExascaleDbStorageVaultsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_list_by_resource_group(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + assert result == [] + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_list_by_subscription(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_subscription() + result = [r async for r in response] + assert response diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_test.py new file mode 100644 index 000000000000..f50546e328c5 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtExascaleDbStorageVaultsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_list_by_resource_group(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + assert result == [] + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_list_by_subscription(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_subscription() + result = [r for r in response] + assert response diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_operations_async_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_operations_async_test.py new file mode 100644 index 000000000000..cc3abb582386 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_operations_async_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r async for r in response] + assert result diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_operations_test.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_operations_test.py new file mode 100644 index 000000000000..0e3ca0368a4a --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tests/test_oracle_database_mgmt_operations_test.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestOracleDatabaseMgmtOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r for r in response] + assert result diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/tsp-location.yaml b/sdk/oracledatabase/azure-mgmt-oracledatabase/tsp-location.yaml new file mode 100644 index 000000000000..42363473dbfb --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/oracle/Oracle.Database.Management +commit: e411473e135e0f0f3c763565ee401be34ccd9f99 +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/oracle/Oracle.Database.Management/models diff --git a/sdk/servicebus/azure-servicebus/README.md b/sdk/servicebus/azure-servicebus/README.md index f52214844f76..5488bd3450fd 100644 --- a/sdk/servicebus/azure-servicebus/README.md +++ b/sdk/servicebus/azure-servicebus/README.md @@ -95,11 +95,11 @@ To interact with these resources, one should be familiar with the following SDK ### Thread safety -We do not guarantee that the ServiceBusClient, ServiceBusSender, and ServiceBusReceiver are thread-safe or coroutine-safe. We do not recommend reusing these instances across threads or sharing them between coroutines. It is up to the running application to use these classes in a concurrency-safe manner. +We do not guarantee that the `ServiceBusClient`, `ServiceBusSender`, and `ServiceBusReceiver` are thread-safe or coroutine-safe. We do not recommend reusing these instances across threads or sharing them between coroutines. It is up to the running application to use these classes in a concurrency-safe manner. The data model type, `ServiceBusMessageBatch` is not thread-safe or coroutine-safe. It should not be shared across threads nor used concurrently with client methods. -For scenarios requiring concurrent sending from multiple threads, ensure proper thread-safety management using mechanisms like threading.Lock(). **Note:** Native async APIs should be used instead of running in a ThreadPoolExecutor, if possible. +For scenarios requiring concurrent sending from multiple threads, ensure proper thread-safety management using mechanisms like `threading.Lock()`. **Note:** Native async APIs should be used instead of running in a `ThreadPoolExecutor`, if possible. ```python import threading from concurrent.futures import ThreadPoolExecutor @@ -128,7 +128,7 @@ with client: executor.submit(send_batch, i, sender) ``` -For scenarios requiring concurrent sending in asyncio applications, ensure proper coroutine-safety management using mechanisms like asyncio.Lock() +For scenarios requiring concurrent sending in asyncio applications, ensure proper coroutine-safety management using mechanisms like `asyncio.Lock()`. ```python import asyncio from azure.servicebus.aio import ServiceBusClient diff --git a/sdk/servicebus/azure-servicebus/TROUBLESHOOTING.md b/sdk/servicebus/azure-servicebus/TROUBLESHOOTING.md new file mode 100644 index 000000000000..3715cd34086b --- /dev/null +++ b/sdk/servicebus/azure-servicebus/TROUBLESHOOTING.md @@ -0,0 +1,411 @@ +# Troubleshoot Azure Service Bus client library issues + +This troubleshooting guide contains instructions to diagnose frequently encountered issues while using the Azure Service Bus client library for Python. + +## Table of contents + +* [General troubleshooting](#general-troubleshooting) + * [Enable client logging](#enable-client-logging) + * [Common exceptions](#common-exceptions) + * [Authentication exceptions](#authentication-exceptions) + * [Connection and timeout exceptions](#connection-and-timeout-exceptions) + * [Message and session handling exceptions](#message-and-session-handling-exceptions) + * [Service and entity exceptions](#service-and-entity-exceptions) + * [Auto lock renewal exceptions](#auto-lock-renewal-exceptions) +* [Threading and concurrency issues](#threading-and-concurrency-issues) + * [Thread safety limitations](#thread-safety-limitations) +* [Troubleshooting authentication and authorization issues](#troubleshooting-authentication-and-authorization-issues) +* [Troubleshooting connectivity issues](#troubleshooting-connectivity-issues) + * [Timeout when connecting to service](#timeout-when-connecting-to-service) + * [SSL handshake failures](#ssl-handshake-failures) + * [Specifying AMQP over WebSockets](#specifying-amqp-over-websockets) + * [Using Service Bus with Azure Identity](#using-service-bus-with-azure-identity) + * [Entity not found errors](#entity-not-found-errors) +* [Troubleshooting message handling issues](#troubleshooting-message-handling-issues) + * [Message and session lock issues](#message-and-session-lock-issues) + * [Message size issues](#message-size-issues) +* [Troubleshooting receiver issues](#troubleshooting-receiver-issues) + * [Number of messages returned doesn't match number requested](#number-of-messages-returned-doesnt-match-number-requested) + * [Mixing sync and async code](#mixing-sync-and-async-code) + * [Dead letter queue issues](#dead-letter-queue-issues) +* [Get additional help](#get-additional-help) + * [Filing GitHub issues](#filing-github-issues) + +## General troubleshooting + +Azure Service Bus client library will raise exceptions defined in [azure.core](https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions) and [azure.servicebus.exceptions](https://docs.microsoft.com/python/api/azure-servicebus/azure.servicebus.exceptions). + +### Enable client logging + +This library uses the standard [logging](https://docs.python.org/3/library/logging.html) library for logging. + +To enable client logging and AMQP frame level trace: + +```python +import logging +import sys + +# Enable client level logging +handler = logging.StreamHandler(stream=sys.stdout) +log_fmt = logging.Formatter(fmt="%(asctime)s | %(threadName)s | %(levelname)s | %(name)s | %(message)s") +handler.setFormatter(log_fmt) +logger = logging.getLogger('azure.servicebus') +logger.setLevel(logging.DEBUG) +logger.addHandler(handler) + +from azure.servicebus import ServiceBusClient +from azure.identity import DefaultAzureCredential + +credential = DefaultAzureCredential() + +# Enable AMQP frame level trace with `logging_enable=True` +client = ServiceBusClient(fully_qualified_namespace, credential, logging_enable=True) +``` + +See full Python SDK logging documentation with examples [here](https://learn.microsoft.com/azure/developer/python/azure-sdk-logging). + +### Common exceptions + +The Service Bus client library will surface exceptions when an error is encountered by a service operation or within the client. For scenarios specific to Service Bus, a [ServiceBusError](https://learn.microsoft.com/python/api/azure-servicebus/azure.servicebus.exceptions.servicebuserror?view=azure-python) will be raised; this is the most common exception type that applications will encounter. + +ServiceBusErrors often have an underlying AMQP error code which specifies whether an error should be retried. For retryable errors (ie. `amqp:connection:forced` or `amqp:link:detach-forced`), the client library will attempt to recover from these errors based on the retry options specified using the following keyword arguments when instantiating the client: + +* `retry_total`: The total number of attempts to redo a failed operation when an error occurs +* `retry_backoff_factor`: A backoff factor to apply between attempts after the second try +* `retry_backoff_max`: The maximum back off time +* `retry_mode`: The delay behavior between retry attempts. Supported values are 'fixed' or 'exponential' +When an exception is surfaced to the application, either all retries were applied unsuccessfully, or the exception was considered non-transient. + +#### Authentication exceptions + +- **ServiceBusAuthenticationError:** An error occurred when authenticating the connection to the service. This may have been caused by the credentials being incorrect. It is recommended to check the credentials. + +- **ServiceBusAuthorizationError:** An error occurred when authorizing the connection to the service. This may have been caused by the credentials not having the right permission to perform the operation, or could be transient due to clock skew or service issues. The client will retry these errors automatically. If you continue to see this exception, it means all configured retries were exhausted - check the permission of the credentials and consider adjusting [retry configuration](#common-exceptions). + +See the [Troubleshooting Authentication issues](#troubleshooting-authentication-issues) section to troubleshoot authentication/permission issues. + +#### Connection and timeout exceptions + +- **ServiceBusConnectionError:** An error occurred in the connection to the service. This may have been caused by a transient network issue or service problem. The client automatically retries these errors - if you see this exception, all configured retries were exhausted. Consider adjusting [retry configuration](#common-exceptions) rather than implementing additional retry logic. + +- **OperationTimeoutError:** This indicates that the service did not respond to an operation within the expected amount of time. This may have been caused by a transient network issue or service problem. The service may or may not have successfully completed the request; the status is not known. The client automatically retries these errors - if you see this exception, all configured retries were exhausted. Consider verifying the current state and adjusting retry configuration if necessary. + +- **ServiceBusCommunicationError:** Client isn't able to establish a connection to Service Bus. Make sure the supplied host name is correct and the host is reachable. If your code runs in an environment with a firewall/proxy, ensure that the traffic to the Service Bus domain/IP address and ports isn't blocked. For details on which ports need to be open, see the [Azure Service Bus FAQ: What ports do I need to open on the firewall?](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-faq#what-ports-do-i-need-to-open-on-the-firewall--). You can also try setting the [WebSockets transport type](#specifying-amqp-over-websockets) which often works around port/firewall issues. + +See the [Troubleshooting Connectivity issues](#troubleshooting-connectivity-issues) section to troubleshoot connection and timeout issues. More information on AMQP errors in Azure Service Bus can be found [here](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-amqp-troubleshoot). + +#### Message and session handling exceptions + +- **MessageSizeExceededError:** This indicates that the max message size has been exceeded. The message size includes the body of the message, as well as any associated metadata and system overhead. The best approach for resolving this error is to reduce the number of messages being sent in a batch or the size of the body included in the message. Because size limits are subject to change, please refer to [Service Bus quotas](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-quotas) for specifics. + +- **MessageAlreadySettled:** This indicates failure to settle the message. This could happen when trying to settle an already-settled message. + +- **MessageNotFoundError:** This occurs when attempting to receive a deferred message by sequence number for a message that either doesn't exist in the entity, or is currently locked. + +- **MessageLockLostError:** Indicates that the lock on the message is lost. Callers should attempt to receive and process the message again. This exception only applies to entities that don't use sessions. This error occurs if processing takes longer than the lock duration and the message lock isn't renewed. This error can also occur when the link is detached due to a transient network issue or when the link is idle for 10 minutes, as enforced by the service. `AutoLockRenewer` could help on keeping the lock of the message automatically renewed. + +- **SessionLockLostError:** The lock on the session has expired. All unsettled messages that have been received can no longer be settled. It is recommended to reconnect to the session if receive messages again if necessary. You should be aware of the lock duration of a session and keep renewing the lock before expiration in case of long processing time. `AutoLockRenewer` could help on keeping the lock of the session automatically renewed. + +- **SessionCannotBeLockedError:** Attempt to connect to a session with a specific session ID, but the session is currently locked by another client. Make sure the session is unlocked by other clients. + +See the [Troubleshooting message handling issues](#troubleshooting-message-handling-issues) section to troubleshoot message and session lock issues. + +#### Service and entity exceptions + +- **ServiceBusQuotaExceededError:** This typically indicates that there are too many active receive operations for a single entity. In order to avoid this error, reduce the number of potential concurrent receives. You can use batch receives to attempt to receive multiple messages per receive request. Please see [Service Bus quotas](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-quotas) for more information. + +- **ServiceBusServerBusyError:** Service isn't able to process the request at this time. Client can wait for a period of time, then retry the operation. For more information about quotas and limits, see [Service Bus quotas](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-quotas). + +- **MessagingEntityNotFoundError:** Entity associated with the operation doesn't exist or it has been deleted. Please make sure the entity exists. + +- **MessagingEntityDisabledError:** Request for a runtime operation on a disabled entity. Please activate the entity. + +#### Auto lock renewal exceptions + +- **AutoLockRenewFailed:** An attempt to renew a lock on a message or session in the background has failed. This could happen when the receiver used by `AutoLockRenewer` is closed or the lock of the renewable has expired. It is recommended to re-register the renewable message or session by receiving the message or connect to the sessionful entity again. + +- **AutoLockRenewTimeout:** The time allocated to renew the message or session lock has elapsed. You could re-register the object that wants be auto lock renewed or extend the timeout in advance. + +See the [Troubleshooting message handling issues](#troubleshooting-message-handling-issues) to help troubleshoot `AutoLockRenewer` errors. + +## Threading and concurrency issues + +### Thread safety limitations + +> **IMPORTANT:** We do not guarantee that the `ServiceBusClient`, `ServiceBusSender`, and `ServiceBusReceiver` are thread-safe or coroutine-safe. We do not recommend reusing these instances across threads or sharing them between coroutines. + +The data model type, `ServiceBusMessageBatch` is not thread-safe or coroutine-safe. It should not be shared across threads nor used concurrently with client methods. + +Using the same client instances across multiple threads or tasks without proper synchronization can lead to: + +- Connection errors and unexpected exceptions +- Message corruption or loss +- Deadlocks and race conditions +- Unpredictable behavior + +It is up to the running application to use these classes in a concurrency-safe manner. + +For scenarios requiring concurrent sending in asyncio applications, ensure proper coroutine-safety management using mechanisms like `asyncio.Lock()`. + +```python +import asyncio +from azure.servicebus.aio import ServiceBusClient +from azure.servicebus import ServiceBusMessage +from azure.identity.aio import DefaultAzureCredential + +SERVICE_BUS_NAMESPACE = ".servicebus.windows.net" +QUEUE_NAME = "" + +lock = asyncio.Lock() + +async def send_batch(sender_id, sender): + async with lock: + messages = [ServiceBusMessage(f"Message {i} from sender {sender_id}") for i in range(10)] + await sender.send_messages(messages) + print(f"Sender {sender_id} sent messages.") + +credential = DefaultAzureCredential() +client = ServiceBusClient(fully_qualified_namespace=SERVICE_BUS_NAMESPACE, credential=credential) + +async with client: + sender = client.get_queue_sender(queue_name=QUEUE_NAME) + async with sender: + await asyncio.gather(*(send_batch(i, sender) for i in range(5))) +``` + +For scenarios requiring concurrent sending from multiple threads, ensure proper thread-safety management using mechanisms like `threading.Lock()`. + +> **NOTE:** Native async APIs should be used instead of running in a `ThreadPoolExecutor`, if possible. + +```python +import threading +from concurrent.futures import ThreadPoolExecutor +from azure.servicebus import ServiceBusClient, ServiceBusMessage +from azure.identity import DefaultAzureCredential + +SERVICE_BUS_NAMESPACE = ".servicebus.windows.net" +QUEUE_NAME = "" + +lock = threading.Lock() + +def send_batch(sender_id, sender): + with lock: + messages = [ServiceBusMessage(f"Message {i} from sender {sender_id}") for i in range(10)] + sender.send_messages(messages) + print(f"Sender {sender_id} sent messages.") + +credential = DefaultAzureCredential() +client = ServiceBusClient(fully_qualified_namespace=SERVICE_BUS_NAMESPACE, credential=credential) + +with client: + sender = client.get_queue_sender(queue_name=QUEUE_NAME) + with sender: + with ThreadPoolExecutor(max_workers=5) as executor: + for i in range(5): + executor.submit(send_batch, i, sender) +``` + +## Troubleshooting authentication and authorization issues + +Authentication errors typically occur when the credentials provided are incorrect or have expired. Authorization errors occur when the authenticated identity doesn't have sufficient permissions. + +The following verification steps are recommended, depending on the type of authorization provided when constructing the client: + +- [Verify the connection string is correct](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-quickstart-portal#get-the-connection-string) + +- [Verify the SAS token was generated correctly](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-sas) + +- [Verify the correct RBAC roles were granted](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-managed-service-identity) - Indicated by errors: `Send/Listen claim(s) are required to perform this operation.` In this case, ensure that the appropriate roles were assigned: `Azure Service Bus Data Owner`, `Azure Service Bus Data Sender`, or `Azure Service Bus Data Receiver`. + +## Troubleshooting connectivity issues + +### Timeout when connecting to service + +Depending on the host environment and network, this may present to applications as timeout or operation exceptions. This most often occurs when the client cannot find a network path to the service. + +To troubleshoot: + +- Verify that the connection string or fully qualified domain name specified when creating the client is correct. For information on how to acquire a connection string, see: [Get a Service Bus connection string](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-quickstart-portal#get-the-connection-string). + +- Check the firewall and port permissions in your hosting environment and that the AMQP ports 5671 and 5672 are open and that the endpoint is allowed through the firewall. + +- Try using the WebSocket transport option, which connects using port 443. This can be done by passing the [`transport_type=TransportType.AmqpOverWebsocket`](https://learn.microsoft.com/python/api/azure-servicebus/azure.servicebus.transporttype?view=azure-python) to the client. + +- See if your network is blocking specific IP addresses. For details, see: [What IP addresses do I need to allow?](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-faq#what-ip-addresses-do-i-need-to-add-to-allowlist-). + +- If applicable, verify the proxy configuration. For details, see: [Proxy sample](https://github.com/Azure/azure-sdk-for-python/blob/fb9f99e09a0968e51839f8456ad69b0354837f95/sdk/servicebus/azure-servicebus/samples/sync_samples/proxy.py). + +### SSL handshake failures + +This error can occur when an intercepting proxy is used. To verify, it is recommended that the application be tested in the host environment with the proxy disabled. Note that intercepting proxies are not a supported scenario. + +### Specifying AMQP over WebSockets + +To configure WebSocket use, pass the [`transport_type=TransportType.AmqpOverWebsocket`](https://learn.microsoft.com/python/api/azure-servicebus/azure.servicebus.transporttype?view=azure-python) to the `ServiceBusClient`. + +### Using Service Bus with Azure Identity + +To authenticate with Azure Identity, see: [Client Identity Authentication](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/servicebus/azure-servicebus/samples/sync_samples/client_identity_authentication.py). + +For more information about the `azure-identity` library, see: [Azure Identity client library for Python][https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python]. + +### Entity not found errors + +**MessagingEntityNotFoundError resolution:** +1. Verify the queue/topic/subscription name is spelled correctly +2. Ensure the Service Bus namespace and entity exist +3. Check if the entity was deleted and needs to be recreated + +## Troubleshooting message handling issues + +### Message and session lock issues + +Messages, sessionful and non-sessionful, in Service Bus have a lock duration during which they must be settled (completed, abandoned, etc.). + +**MessageLockLostError and SessionLockLostError resolution:** +1. Process messages faster or increase lock duration +2. If setting `prefetch_count` to a large number, consider setting it lower as the lock timer starts running when the message is fetched, even though not visible to the application and the client cannot extend locks for prefetched messages. +3. Use `AutoLockRenewer` for long-running processing. + * When running the async `AutoLockRenewer`, ensure that the event loop is not blocked during message processing. (e.g. `time.sleep(60)` --> `await asyncio.sleep(60)`). Otherwise, the `AutoLockRenewer` will be prevented from running in the background. + +```python +from azure.servicebus import AutoLockRenewer + +renewer = AutoLockRenewer() +with receiver: + received_msgs = receiver.receive_messages(max_message_count=10) + for message in received_msgs: + renewer.register(receiver, message, max_lock_renewal_duration=300) + # Process message + receiver.complete_message(message) +``` + +### Message size issues + +**MessageSizeExceededError resolution:** +1. Reduce message payload size. +2. Consider splitting large messages across multiple smaller messages. For the most up-to-date information on Service Bus message size limits, refer to the [Azure Service Bus quotas and limits](https://learn.microsoft.com/azure/service-bus-messaging/service-bus-quotas) documentation. + +## Troubleshooting receiver issues + +### Number of messages returned doesn't match number requested + +When attempting to receive multiple messages using `receive_messages()` with `max_message_count` greater than 1, you're not guaranteed to receive the exact number requested. + +**Why this happens:** +- Service Bus optimizes for throughput and latency +- After the first message is received, the receiver prioritizes processing it and does not attempt to build a batch of the requested size +- The `max_wait_time` controls how long to wait for the **first** message, not subsequent ones + +**Resolution:** +1. **Don't assume all available messages will be received in one call:** +```python +import time +from azure.servicebus.exceptions import MessagingEntityNotFoundError, MessagingEntityDisabledError + +def receive_all_available_messages(receiver, total_expected=None): + """Receive all available messages from a queue/subscription""" + all_messages = [] + + while True: + # Receive in batches + messages = receiver.receive_messages(max_message_count=10, max_wait_time=5) + + if not messages: + break # No more messages available + + all_messages.extend(messages) + + # Process messages immediately to avoid lock expiration + for message in messages: + try: + # Process message logic here + print(f"Processing: {message}") + receiver.complete_message(message) + except Exception as e: + print(f"Error processing message: {e}") + receiver.abandon_message(message) + + return all_messages +``` + +2. **Use continuous receiving for stream processing:** +```python +import time + +def continuous_message_processing(receiver): + """Continuously process messages as they arrive""" + while True: + try: + messages = receiver.receive_messages(max_message_count=1, max_wait_time=60) + + for message in messages: + # Process immediately + try: + process_message(message) + receiver.complete_message(message) + except Exception as e: + print(f"Processing failed: {e}") + receiver.abandon_message(message) + + except KeyboardInterrupt: + break + except Exception as e: + print(f"Receive error: {e}") + time.sleep(5) # Brief pause before retry +``` + +### Mixing sync and async code + +Mixing synchronous and asynchronous Service Bus operations can cause issues such as the `AutoLockRenewer` hanging indefinitely because the event loop is blocked. Ensure that blocking calls are not made when receiving and processing messages asynchronously. + +### Dead letter queue issues + +Messages can be moved to the dead letter queue for various reasons: + +**Common reasons:** +- Message TTL expired +- Max delivery count exceeded +- Message was explicitly dead lettered +- Message processing failed repeatedly + +**Debugging dead letter messages:** +```python +# Receive from dead letter queue +dlq_receiver = servicebus_client.get_queue_receiver( + queue_name="your_queue", + sub_queue=ServiceBusSubQueue.DEAD_LETTER +) + +with dlq_receiver: + messages = dlq_receiver.receive_messages(max_message_count=10) + for message in messages: + print(f"Dead letter reason: {message.dead_letter_reason}") + print(f"Dead letter description: {message.dead_letter_error_description}") +``` + +## Get additional help + +Additional information on ways to reach out for support can be found in the [SUPPORT.md](https://github.com/Azure/azure-sdk-for-python/blob/main/SUPPORT.md) at the root of the repo. + +### Filing GitHub issues + +When filing GitHub issues for Service Bus, please include: + +1. **Environment details:** + - Python version + - Azure Service Bus SDK version + - Operating system + +2. **Service Bus configuration:** + - Namespace tier (Basic, Standard, Premium) + - Entity configuration (queue, topic, subscription settings) + - Session-enabled or not + +3. **Code sample:** Minimal reproducible code sample + +4. **Logs:** DEBUG level logs with transport logging enabled (see [Enable client logging](#enable-client-logging)) + +5. **Error details:** Complete exception stack trace and error messages + +The more information provided, the faster we can help resolve your issue. diff --git a/sdk/servicebus/azure-servicebus/samples/README.md b/sdk/servicebus/azure-servicebus/samples/README.md index c5d3d6399674..ac90f76ee6c5 100644 --- a/sdk/servicebus/azure-servicebus/samples/README.md +++ b/sdk/servicebus/azure-servicebus/samples/README.md @@ -20,12 +20,12 @@ Both [sync version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/ - From a connection string - Enabling Logging - Send messages concurrently with proper thread/coroutine safety practices - - **Note**: ServiceBusClient, ServiceBusSender, and ServiceBusReceiver are not thread-safe or coroutine-safe + - **Note**: `ServiceBusClient`, `ServiceBusSender`, and `ServiceBusReceiver` are not thread-safe or coroutine-safe - [send_topic.py](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/send_topic.py) ([async version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/async_samples/send_topic_async.py)) - Examples to send messages to a service bus topic: - From a connection string - Enabling Logging - Send messages concurrently with proper thread/coroutine safety practices - - **Note**: ServiceBusClient, ServiceBusSender, and ServiceBusReceiver are not thread-safe or coroutine-safe + - **Note**: `ServiceBusClient`, `ServiceBusSender`, and `ServiceBusReceiver` are not thread-safe or coroutine-safe - [receive_queue.py](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_queue.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/async_samples/receive_queue_async.py)) - Examples to receive messages from a service bus queue: - Receive messages - [receive_subscription.py](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/sync_samples/receive_subscription.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/samples/async_samples/receive_subscription_async.py)) - Examples to receive messages from a service bus subscription: diff --git a/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py b/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py index c1ada7751ab1..f63479a0493a 100644 --- a/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py +++ b/sdk/servicebus/azure-servicebus/samples/sync_samples/send_queue.py @@ -8,13 +8,13 @@ """ Example to show sending message(s) to a Service Bus Queue. -WARNING: ServiceBusClient, ServiceBusSender, and ServiceBusMessageBatch are not thread-safe. -Do not share these instances between threads without proper thread-safe management using mechanisms like threading.Lock. +WARNING: `ServiceBusClient`, `ServiceBusSender`, and `ServiceBusMessageBatch` are not thread-safe. +Do not share these instances between threads without proper thread-safe management using mechanisms like `threading.Lock()`. +Note: Native async APIs should be used instead of running in a `ThreadPoolExecutor`, if possible. """ import os import threading -import asyncio from concurrent.futures import ThreadPoolExecutor from azure.servicebus import ServiceBusClient, ServiceBusMessage @@ -47,9 +47,6 @@ def send_batch_message(sender): sender.send_messages(batch_message) - - - def send_concurrent_with_shared_client_and_lock(): """ Example showing concurrent sending with a shared client using threading.Lock. @@ -79,32 +76,6 @@ def send_with_lock(thread_id): for future in futures: future.result() - -def send_with_run_in_executor(): - """ - Example showing how to use asyncio.run_in_executor for sync operations in async context. - This is useful when you need to call sync Service Bus operations from async code. - """ - async def async_main(): - loop = asyncio.get_event_loop() - - def sync_send_operation(): - credential = DefaultAzureCredential() - servicebus_client = ServiceBusClient(FULLY_QUALIFIED_NAMESPACE, credential) - with servicebus_client: - sender = servicebus_client.get_queue_sender(queue_name=QUEUE_NAME) - with sender: - message = ServiceBusMessage("Message sent via run_in_executor") - sender.send_messages(message) - return "Message sent successfully" - - # Run the synchronous operation in an executor - result = await loop.run_in_executor(None, sync_send_operation) - print(f"run_in_executor result: {result}") - - asyncio.run(async_main()) - - credential = DefaultAzureCredential() servicebus_client = ServiceBusClient(FULLY_QUALIFIED_NAMESPACE, credential, logging_enable=True) with servicebus_client: @@ -114,12 +85,7 @@ def sync_send_operation(): send_a_list_of_messages(sender) send_batch_message(sender) -print("Send message is done.") - - + print("Send message is done.") print("\nDemonstrating concurrent sending with shared client and locks...") send_concurrent_with_shared_client_and_lock() - -print("\nDemonstrating run_in_executor pattern...") -send_with_run_in_executor() diff --git a/sdk/servicebus/azure-servicebus/samples/sync_samples/send_topic.py b/sdk/servicebus/azure-servicebus/samples/sync_samples/send_topic.py index 013f129f710f..5d3b1687ee06 100644 --- a/sdk/servicebus/azure-servicebus/samples/sync_samples/send_topic.py +++ b/sdk/servicebus/azure-servicebus/samples/sync_samples/send_topic.py @@ -9,12 +9,12 @@ Example to show sending message(s) to a Service Bus Topic. WARNING: ServiceBusClient, ServiceBusSender, and ServiceBusMessageBatch are not thread-safe. -Do not share these instances between threads without proper thread-safe management using mechanisms like threading.Lock. +Do not share these instances between threads without proper thread-safe management using mechanisms like `threading.Lock()`. +Note: Native async APIs should be used instead of running in a `ThreadPoolExecutor`, if possible. """ import os import threading -import asyncio from concurrent.futures import ThreadPoolExecutor from azure.servicebus import ServiceBusClient, ServiceBusMessage @@ -46,9 +46,6 @@ def send_batch_message(sender): sender.send_messages(batch_message) - - - def send_concurrent_with_shared_client_and_lock(): """ Example showing concurrent sending with a shared client using threading.Lock. @@ -79,31 +76,6 @@ def send_with_lock(thread_id): future.result() -def send_with_run_in_executor(): - """ - Example showing how to use asyncio.run_in_executor for sync operations in async context. - This is useful when you need to call sync Service Bus operations from async code. - """ - async def async_main(): - loop = asyncio.get_event_loop() - - def sync_send_operation(): - credential = DefaultAzureCredential() - servicebus_client = ServiceBusClient(FULLY_QUALIFIED_NAMESPACE, credential) - with servicebus_client: - sender = servicebus_client.get_topic_sender(topic_name=TOPIC_NAME) - with sender: - message = ServiceBusMessage("Message sent via run_in_executor") - sender.send_messages(message) - return "Message sent successfully" - - # Run the synchronous operation in an executor - result = await loop.run_in_executor(None, sync_send_operation) - print(f"run_in_executor result: {result}") - - asyncio.run(async_main()) - - credential = DefaultAzureCredential() servicebus_client = ServiceBusClient(FULLY_QUALIFIED_NAMESPACE, credential, logging_enable=True) with servicebus_client: @@ -113,12 +85,7 @@ def sync_send_operation(): send_a_list_of_messages(sender) send_batch_message(sender) -print("Send message is done.") - - + print("Send message is done.") print("\nDemonstrating concurrent sending with shared client and locks...") send_concurrent_with_shared_client_and_lock() - -print("\nDemonstrating run_in_executor pattern...") -send_with_run_in_executor() From 763d7997912e3a22364d9baee163e59db8e3c550 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Thu, 12 Jun 2025 16:10:38 -0400 Subject: [PATCH 3/5] add attribute_list and tests --- .../azure-core/azure/core/serialization.py | 43 +++++++- .../azure-core/tests/test_serialization.py | 97 ++++++++++++++++++- 2 files changed, 136 insertions(+), 4 deletions(-) diff --git a/sdk/core/azure-core/azure/core/serialization.py b/sdk/core/azure-core/azure/core/serialization.py index 19bc92e1e887..898d6f05d6a8 100644 --- a/sdk/core/azure-core/azure/core/serialization.py +++ b/sdk/core/azure-core/azure/core/serialization.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- import base64 from json import JSONEncoder -from typing import List, Union, cast, Any +from typing import List, Optional, Union, cast, Any from datetime import datetime, date, time, timedelta from datetime import timezone @@ -141,6 +141,36 @@ def is_generated_model(obj: Any) -> bool: """ return bool(getattr(obj, "_is_model", False) or hasattr(obj, "_attribute_map")) + +def _get_flattened_attribute(obj: Any) -> Optional[str]: + """Get the name of the flattened attribute in a generated TypeSpec model if one exists. + + :param any obj: The object to check. + :return: The name of the flattened attribute if it exists, otherwise None. + :rtype: Optional[str] + """ + flattened_items = None + try: + flattened_items = getattr(obj, next(a for a in dir(obj) if "__flattened_items" in a), None) + except StopIteration: + return None + + if flattened_items is None: + return None + + for k, v in obj._attr_to_rest_field.items(): # pylint: disable=protected-access + try: + if set(v._class_type._attr_to_rest_field.keys()).intersection( # pylint: disable=protected-access + set(flattened_items) + ): + return k + return k + except AttributeError: + # if the attribute does not have _class_type, it is not a typespec generated model + continue + return None + + def attribute_list(obj: Any) -> List[str]: """Get a list of attribute names for a generated SDK model. @@ -153,5 +183,12 @@ def attribute_list(obj: Any) -> List[str]: raise TypeError("Object is not a generated SDK model.") if hasattr(obj, "_attribute_map"): # msrest model - return list(obj._attribute_map.keys()) - + return list(obj._attribute_map.keys()) # pylint: disable=protected-access + flattened_attribute = _get_flattened_attribute(obj) + retval: List[str] = [] + for attr_name, rest_field in obj._attr_to_rest_field.items(): # pylint: disable=protected-access + if flattened_attribute == attr_name: + retval.extend(attribute_list(rest_field._class_type)) # pylint: disable=protected-access + else: + retval.append(attr_name) + return retval diff --git a/sdk/core/azure-core/tests/test_serialization.py b/sdk/core/azure-core/tests/test_serialization.py index 4cb81eba6620..41370d7d84a8 100644 --- a/sdk/core/azure-core/tests/test_serialization.py +++ b/sdk/core/azure-core/tests/test_serialization.py @@ -8,7 +8,7 @@ import json import sys -from azure.core.serialization import AzureJSONEncoder, NULL, is_generated_model +from azure.core.serialization import AzureJSONEncoder, NULL, is_generated_model, attribute_list import pytest from modeltest._utils.model_base import Model as HybridModel, rest_field from modeltest import models @@ -554,3 +554,98 @@ def __init__(self): self.attr = "value" assert not is_generated_model(Model()) + + +def test_attribute_list_non_model(): + with pytest.raises(TypeError): + attribute_list({}) + + with pytest.raises(TypeError): + attribute_list([]) + + with pytest.raises(TypeError): + attribute_list("string") + + with pytest.raises(TypeError): + attribute_list(42) + + with pytest.raises(TypeError): + attribute_list(None) + + with pytest.raises(TypeError): + attribute_list(object) + + class RandomModel: + def __init__(self): + self.attr = "value" + + with pytest.raises(TypeError): + attribute_list(RandomModel()) + + +def test_attribute_list_scratch_model(): + model = models.Scratch(prop="wall-e") + assert attribute_list(model) == ["prop"] + + class MsrestScratchModel: + _attribute_map = {"prop": {"key": "prop", "type": "str"}} + + def __init__(self, prop): + self.prop = prop + + msrest_model = MsrestScratchModel(prop="wall-e") + assert attribute_list(msrest_model) == ["prop"] + + +def test_attribute_list_client_named_property_model(): + model = models.ClientNamedPropertyModel(prop_client_name="wall-e") + assert attribute_list(model) == ["prop_client_name"] + + class MsrestClientNamedPropertyModel: + _attribute_map = {"prop_client_name": "propClientName"} + + def __init__(self, prop_client_name): + self.prop_client_name = prop_client_name + + msrest_model = MsrestClientNamedPropertyModel(prop_client_name="wall-e") + assert attribute_list(msrest_model) == ["prop_client_name"] + + +def test_attribute_list_flattened_model(): + model = models.FlattenModel(name="wall-e", description="a dog", age=2) + assert attribute_list(model) == ["name", "description", "age"] + + class MsrestFlattenedModel: + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "properties.description", "type": "str"}, + "age": {"key": "properties.age", "type": "int"}, + } + + def __init__(self, name, description, age, **kwargs): + super().__init__(**kwargs) + self.name = name + self.description = description + self.age = age + + msrest_model = MsrestFlattenedModel(name="wall-e", description="a dog", age=2) + assert attribute_list(msrest_model) == ["name", "description", "age"] + + +def test_attribute_list_readonly_model(): + model = models.ReadonlyModel({"id": 1}) + assert attribute_list(model) == ["id"] + + class MsrestReadonlyModel: + _validation = { + "id": {"readonly": True}, + } + _attribute_map = { + "id": {"key": "id", "type": "int"}, + } + + def __init__(self, id): + self.id = id + + msrest_model = MsrestReadonlyModel(id=1) + assert attribute_list(msrest_model) == ["id"] From 53385aecc6cb700d5abb7d2063c1f03d0b1323ac Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Thu, 12 Jun 2025 16:15:06 -0400 Subject: [PATCH 4/5] add changeset --- sdk/core/azure-core/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index f542990e195f..be38df4f4b34 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -7,6 +7,7 @@ - Added a `start_time` keyword argument to the `start_span` and `start_as_current_span` methods in the `OpenTelemetryTracer` class. This allows users to specify a custom start time for created spans. #41106 - Added a `context` keyword argument to the `start_span` and `start_as_current_span` methods in the `OpenTelemetryTracer` class. This allows users to specify a custom parent context for created spans. #41511 - Added `is_generated_model` method to `azure.core.serialization`. Returns whether a given input is a model from one of our generated sdks. #41445 +- Added `attribute_list` method to `azure.core.serialization`. Returns all of the attributes of a given model from one of our generated sdks. #41571 ### Breaking Changes From 37ea42bf5efd7ef6fb99575d052a190d181aceae Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Thu, 12 Jun 2025 16:47:48 -0400 Subject: [PATCH 5/5] add additional properties test --- .../azure-core/tests/test_serialization.py | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/sdk/core/azure-core/tests/test_serialization.py b/sdk/core/azure-core/tests/test_serialization.py index 41370d7d84a8..3a2e3b62860f 100644 --- a/sdk/core/azure-core/tests/test_serialization.py +++ b/sdk/core/azure-core/tests/test_serialization.py @@ -7,10 +7,12 @@ from enum import Enum import json import sys +from typing import Any, Dict, Optional from azure.core.serialization import AzureJSONEncoder, NULL, is_generated_model, attribute_list import pytest from modeltest._utils.model_base import Model as HybridModel, rest_field +from modeltest._utils.serialization import Model as MsrestModel from modeltest import models @@ -587,7 +589,7 @@ def test_attribute_list_scratch_model(): model = models.Scratch(prop="wall-e") assert attribute_list(model) == ["prop"] - class MsrestScratchModel: + class MsrestScratchModel(MsrestModel): _attribute_map = {"prop": {"key": "prop", "type": "str"}} def __init__(self, prop): @@ -601,7 +603,7 @@ def test_attribute_list_client_named_property_model(): model = models.ClientNamedPropertyModel(prop_client_name="wall-e") assert attribute_list(model) == ["prop_client_name"] - class MsrestClientNamedPropertyModel: + class MsrestClientNamedPropertyModel(MsrestModel): _attribute_map = {"prop_client_name": "propClientName"} def __init__(self, prop_client_name): @@ -615,7 +617,7 @@ def test_attribute_list_flattened_model(): model = models.FlattenModel(name="wall-e", description="a dog", age=2) assert attribute_list(model) == ["name", "description", "age"] - class MsrestFlattenedModel: + class MsrestFlattenedModel(MsrestModel): _attribute_map = { "name": {"key": "name", "type": "str"}, "description": {"key": "properties.description", "type": "str"}, @@ -636,7 +638,7 @@ def test_attribute_list_readonly_model(): model = models.ReadonlyModel({"id": 1}) assert attribute_list(model) == ["id"] - class MsrestReadonlyModel: + class MsrestReadonlyModel(MsrestModel): _validation = { "id": {"readonly": True}, } @@ -649,3 +651,25 @@ def __init__(self, id): msrest_model = MsrestReadonlyModel(id=1) assert attribute_list(msrest_model) == ["id"] + +def test_attribute_list_additional_properties_hybrid(): + class HybridPetAPTrue(HybridModel): + name: str = rest_field() + + hybrid_model = HybridPetAPTrue({"birthdate": "2017-12-13T02:29:51Z", "complexProperty": {"color": "Red"}, "name": "Buddy"}) + assert attribute_list(hybrid_model) == ["name"] + +def test_attribute_list_additional_properties_msrest(): + class MsrestPetAPTrue(MsrestModel): + _attribute_map = { + "additional_properties": {"key": "", "type": "{object}"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, additional_properties: Optional[Dict[str, Any]], name: Optional[str] = None, **kwargs): + super().__init__(**kwargs) + self.additional_properties = additional_properties + self.name = name + + msrest_model = MsrestPetAPTrue(additional_properties={"birthdate": "2017-12-13T02:29:51Z", "complexProperty": {"color": "Red"}}, name="Buddy") + assert attribute_list(msrest_model) == ["additional_properties", "name"]